@Override public void onClick(View v) { switch (v.getId()) { case R.id.pause_all_btn: DownloadManager.getInstance(ListActivity.this).pauseAll(); break; case R.id.recover_all_btn: DownloadManager.getInstance(ListActivity.this).recoverAll(); break; } }
@Override protected void onResume() { super.onResume(); DownloadManager.getInstance(this).addObserver(dataWatcher); }
@Override protected void onPause() { super.onPause(); DownloadManager.getInstance(this).removeObserver(dataWatcher); }