@Override protected void onCreate(Bundle savedInstanceState) { mContext = getApplicationContext(); mMode = ReadConfigFile.getMode(mContext); if (mMode == 1) { super.onCreate(savedInstanceState, TITLE_TYPE_COMPANY, null, 0, true); } else { super.onCreate(savedInstanceState); } setContentView(R.layout.disscuss_title_layout); setupView(); mListArrayList = new ArrayList<HashMap<String, Object>>(); mListAdapter = new SimpleAdapter( getApplicationContext(), mListArrayList, R.layout.disscus_listitem_layout, new String[] {"title", "desc"}, new int[] {R.id.channel_listitem_title_id, R.id.channel_listitem_desc_id}); mList.setAdapter(mListAdapter); mpageIndex = 1; SharedPreferences userpref = mContext.getSharedPreferences("user", MODE_PRIVATE); mUser_name = userpref.getString("user_name", ""); setupData(); mList.setOnItemClickListener(this); mList.setOnScrollListener(this); mButton.setOnClickListener(this); CloseReceiver.registerCloseActivity(this); CommonUpdate.getInstance() .registerForUpdateWeather(myHandler, CommonUpdate.EVENT_UPDATE_WEATHER, null); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState, TITLE_TYPE_COMPANY, null, 0, true); mContext = getApplicationContext(); setContentView(R.layout.voteview_layout); setupView(); mConnectUrl = getIntent().getStringExtra("link"); setupData(); mImageDownLoad = new ImageDownloader(); CloseReceiver.registerCloseActivity(this); CommonUpdate.getInstance() .registerForUpdateWeather(myHandler, CommonUpdate.EVENT_UPDATE_WEATHER, null); }
@Override protected void onDestroy() { CommonUpdate.getInstance().unregisterForUpdateWeather(myHandler); CloseReceiver.unRegisterActivity(this); super.onDestroy(); }