Пример #1
0
 @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;
   }
 }
Пример #2
0
 @Override
 protected void onResume() {
   super.onResume();
   DownloadManager.getInstance(this).addObserver(dataWatcher);
 }
Пример #3
0
 @Override
 protected void onPause() {
   super.onPause();
   DownloadManager.getInstance(this).removeObserver(dataWatcher);
 }