private void doCheckUpdataTask() { Map<String, Object> taskParams = new HashMap<String, Object>(); taskParams.put(Task.FAN_ACTIVITY, HomePageActivity.class.getSimpleName()); taskParams.put(Task.FAN_AUTHO_SYSTEM_TYPE, Task.FAN_AUTHO_SYSTEM_TYPE_ANDROID); Task task = new Task(Task.FAN_CHECKUPDATE, taskParams); IfanService.addTask(task); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home_page); IfanService.addActivity(this); initData(); initView(); }
private void doLikeTask(String personId) { showProgressDialog(); Map<String, Object> taskParams = new HashMap<String, Object>(); taskParams.put(Task.FAN_ACTIVITY, FindFDActivity.class.getSimpleName()); taskParams.put(Task.FAN_GETMATCH_TYPE, Task.FAN_GETMATCH_TYPE_FANS); taskParams.put(Person.ID, personId); Task task = new Task(Task.FAN_LIKE, taskParams); IfanService.addTask(task); }
private void doExitTask() { finish(); ShareSDK.stopSDK(this); IfanService.emptyList(); Intent intent = new Intent(this, IfanService.class); stopService(intent); android.os.Process.killProcess(android.os.Process.myPid()); /* Map<String, Object> taskParams = new HashMap<String, Object>(); taskParams.put(Task.FAN_ACTIVITY, HomePageActivity.class.getSimpleName()); Task task = new Task(Task.FAN_EXIT, taskParams); IfanService.addTask(task); */ }
private void doCheckNetTask() { User user = SPUtil.getDefaultUser(this, null); Map<String, Object> taskParams = new HashMap<String, Object>(); taskParams.put(Task.FAN_ACTIVITY, HomePageActivity.class.getSimpleName()); taskParams.put(User.PHONENUMBER, user.getPhoneNumber()); taskParams.put(User.PASSWORD, user.getPassword()); taskParams.put(Task.FAN_AUTHO_DEVICE_CODE, JPushInterface.getRegistrationID(this)); taskParams.put(Task.FAN_AUTHO_SYSTEM_TYPE, Task.FAN_AUTHO_SYSTEM_TYPE_ANDROID); if (first_time_login) { taskParams.put(Task.FAN_AUTHO_BACK_LOGIN, Task.FAN_AUTHO_BACK_LOGIN_NO); } else { taskParams.put(Task.FAN_AUTHO_BACK_LOGIN, Task.FAN_AUTHO_BACK_LOGIN_YES); } Task task = new Task(Task.FAN_AUTHO, taskParams); IfanService.addTask(task); }
public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (IntentString.Receiver.NEW_INFO.equals(action)) { String type = intent.getStringExtra(IntentString.Push.TYPE); if (IntentString.Push.TYPE_FORCE_QUIT.equals(type)) { ToastUtil.longPrompt(context, "您的帐号在其它设备上登录,您被强迫下线!"); IfanService.emptyList(); SPUtil.saveDefaultUser(context, User.ID, null); Intent forceQuitIntent = new Intent(context, AuthoActivity.class); forceQuitIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(forceQuitIntent); } else if (IntentString.Push.TYPE_STATUS_INFO.equals(type)) { if (curIndex == INDEX_GROUP) { GroupActivity groupActivity = (GroupActivity) getLocalActivityManager().getActivity(tabs[INDEX_GROUP]); groupActivity.refreshNewInfo(); } } else if (IntentString.Push.TYPE_HAS_MATCH.equals(type)) { FindActivity findActivity = (FindActivity) getLocalActivityManager().getActivity(tabs[INDEX_FIND]); findActivity.doGetMatchTask(); } else if (IntentString.Push.TYPE_GIRL_LIKE_YOU.equals(type)) { FindActivity findActivity = (FindActivity) getLocalActivityManager().getActivity(tabs[INDEX_FIND]); findActivity.doGetMatchTask(); } else if (IntentString.Push.TYPE_NEW_FRIEND.equals(type)) { Intent nfIntent = new Intent(IntentString.Receiver.NEW_FRIEND); sendBroadcast(nfIntent); } else if (IntentString.Push.TYPE_BOY_LIKE_YOU.equals(type)) { if (curIndex == INDEX_FIND) { FindActivity findActivity = (FindActivity) getLocalActivityManager().getActivity(tabs[INDEX_FIND]); findActivity.refreshNewInfo(); } } } }
@Override protected void onDestroy() { super.onDestroy(); IfanService.removeActivity(this); }