@Override protected void postInitUI() { super.postInitUI(); mAdapter = new AlarmListAdapter(this); mAdapter.setCache(controller.getCache()); controller.addObserver(mAdapter); mAdapter.setClockAction(controller); lvAlarm.setAdapter(mAdapter); lvAlarm.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Log.d(Clock.TAG, "default click"); TemporaryData.save(Clock.class.getName(), controller.getCache().read().get(position)); TemporaryData.save(ClockController.class.getName(), controller); AlarmEditActivity.callMe(AlarmListActivity.this); } }); lvAlarm.setOnItemLongClickListener( new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { showDialog(controller.getCache().read().get(position)); return true; } }); controller.checkDefaultClockPolicy(); }
@Override protected void initUI() { super.initUI(); setContentView(R.layout.activity_alarm_main); lvAlarm = (ListView) findViewById(id.lv_alarm); updateUI(); }
@Override protected void preLoadData(Bundle savedInstanceState) { super.preLoadData(savedInstanceState); account = AccountProxy.getInstance().getCurrentAccount(); /** 获取身体状况资料 */ mBodyStateTask = new EditQAHealthTask(account.getAccessToken(), null, null, null, true, "sick_"); mBodyStateTask.setProgress( new CustomDialogProgress(this, getString(string.punlic_personal_loading))); mBodyStateTask.setTaskHost( new TaskHost() { @Override public void onPostExecute(int requestCode, BaseResult result) { super.onPostExecute(requestCode, result); switch (result.getErrorCode()) { case LocalCode.CODE_SUCCESS: bodyStates = QAHealth.createQAHealthList((NetworkClientResult) result); AccountPreference.getInstance().saveBodyState(bodyStates); fillView(); break; default: ErrorDialogUtil.showErrorToast( SettingChangeBodyStateActivity.this, CloudStatusCodeProxy.TYPE_SETTING, result.getErrorCode()); finish(); break; } } }); mBodyStateTask.execute(); }
@Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); PropertyCenter.getInstance().removePropertyChangeListener(this); if (controller != null) { if (mAdapter != null) { controller.deleteObserver(mAdapter); mAdapter = null; } controller.clearCache(); controller = null; } }
@Override protected void postInitUI() { super.postInitUI(); etContent.setOnKeyListener( new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN) { uploadFeedBackInfo(); return true; } return false; } }); }
@Override protected void preInitUI() { super.preInitUI(); initActionBar(); }
@Override protected void preLoadData(Bundle savedInstanceState) { super.preLoadData(savedInstanceState); PropertyCenter.getInstance().addPropertyChangeListener(this); controller = new ClockController(); }
@Override protected void onStop() { super.onStop(); }
@Override protected void onStart() { super.onStart(); }
@Override protected void initUI() { super.initUI(); setContentView(R.layout.activity_setting_feed_back); etContent = (CleanableEditText) this.findViewById(R.id.ce_feed_back); }
@Override protected void preLoadData(Bundle savedInstanceState) { super.preLoadData(savedInstanceState); currentAccount = AccountProxy.getInstance().getCurrentAccount(); agent = new FeedbackAgent(this); }