protected void onCreate(Bundle bundle) { logger.v("onCreate() ---> Enter"); super.onCreate(bundle); requestWindowFeature(1); setContentView(R.layout.activity_online_music_column_detail_layout); mController = Controller.getInstance(MobileMusicApplication.getInstance()); mViewFlipper = (ViewFlipper) findViewById(R.id.song_viewflipper); mTitleBar = (TitleBarView) findViewById(R.id.title_view); Intent intent = getIntent(); if (intent.getExtras() != null) { mTitleBar.setTitle(intent.getStringExtra("title")); title = intent.getStringExtra("title"); mIsFromPushService = intent.getBooleanExtra("fromPushService", false); } MusicListColumnItem musiclistcolumnitem = (MusicListColumnItem) intent.getParcelableExtra("COLUMITEM"); logger.v("MusicListColumnItem.category_type ----" + musiclistcolumnitem.category_type); switch (Integer.parseInt(musiclistcolumnitem.category_type)) { case 1: deleteType = 0; SongListView songlistview = new SongListView(this); songlistview.setURL(musiclistcolumnitem.url); songlistview.setName(musiclistcolumnitem.title); mViewInterface = songlistview; mViewFlipper.addView(songlistview); break; case 2: break; default: break; } logger.v("onCreate() ---> Exit"); }
protected void onResume() { logger.v("onResume() ---> Enter"); super.onResume(); MobclickAgent.onResume(this); this.mViewInterface.addListner(); ((SongListView) mViewInterface).getDataFromURL(); // 返回按钮 mTitleBar.setLeftBtnOnlickListner( new View.OnClickListener() { public void onClick(View view) { if (mIsFromPushService) { Intent intent = new Intent( MusicOnlineMusicColumnDetailActivity.this, MobileMusicMainActivity.class); intent.putExtra("startFromNotification", true); startActivity(intent); finish(); } else { finish(); } } }); if (SongListView.mListButtonClickListener != null) SongListView.mListButtonClickListener.doUnCompleteTask(); logger.v("onResume() ---> Exit"); return; }
protected void onPause() { logger.v("onPause() ---> Enter"); super.onPause(); MobclickAgent.onPause(this); this.mViewInterface.removeListner(); logger.v("onPause() ---> Exit"); }
public void handleSystemEvent(Message paramMessage) { logger.v("handleSystemEvent() ---> Enter"); switch (paramMessage.what) { default: logger.v("handleSystemEvent() ---> Exit"); break; case 22: finish(); break; } }
protected void onDestroy() { logger.v("onCreate() ---> Enter"); this.mController.removeSystemEventListener(22, this); int i; if (this.mViewFlipper != null) { this.mViewFlipper.destroyDrawingCache(); i = 0; while (true) { i++; if (this.deleteType == 1) { ColumnListView localColumnListView = (ColumnListView) this.mViewFlipper.getChildAt(i); if (localColumnListView != null) { localColumnListView.releaseResource(); localColumnListView.destroyDrawingCache(); } } if (i >= this.mViewFlipper.getChildCount()) { this.mViewFlipper.removeAllViews(); logger.v("onCreate() ---> Exit"); super.onDestroy(); return; } else { if (deleteType == 0) { SongListView songlistview = (SongListView) mViewFlipper.getChildAt(i); if (songlistview != null) { songlistview.releaseResource(); songlistview.destroyDrawingCache(); } } } } } else { this.mViewFlipper = null; this.mViewInterface = null; this.mTitleBar = null; super.onDestroy(); logger.v("onCreate() ---> Exit"); return; } }
public boolean onKeyDown(int i, KeyEvent keyevent) { logger.v("onKeyDown() ----> Enter"); boolean flag = true; if (i == 4) { if ((SongListView.mListButtonClickListener != null) && (SongListView.mListButtonClickListener.closePopupWindow())) return flag; else { if (mIsFromPushService) { Intent intent = new Intent(this, MobileMusicMainActivity.class); intent.putExtra("startFromNotification", flag); startActivity(intent); finish(); } else { finish(); } } } flag = super.onKeyDown(i, keyevent); logger.v("flag ---- " + flag); logger.v("onKeyDown() ----> Exit"); return flag; }