Esempio n. 1
0
 public void initDownload() {
   /**
    * get download id from preferences.<br>
    * if download id bigger than 0, means it has been downloaded, then query status and show right
    * text;
    */
   downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
   downloadManagerPro = new DownloadManagerPro(downloadManager);
   downloadId = PreferencesUtils.getLong(getBaseContext(), KEY_NAME_DOWNLOAD_ID);
   completeReceiver = new CompleteReceiver();
   /** register download success broadcast * */
   registerReceiver(completeReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
   initDownloaderDir();
 }