+ \r
+ /**\r
+ * Callback method to update the progress bar in the status notification (old version)\r
+ */\r
+ @Override\r
+ public void onTransferProgress(long progressRate) {\r
+ // NOTHING TO DO HERE ANYMORE\r
+ }\r
+ \r
+\r
+ /**\r
+ * Creates a status notification to show the download progress\r
+ * \r
+ * @param download Download operation starting.\r
+ */\r
+ private void notifyDownloadStart(DownloadFileOperation download) {\r
+ /// create status notification to show the download progress\r
+ mLastPercent = 0;\r
+ mNotification = new Notification(R.drawable.icon, getString(R.string.downloader_download_in_progress_ticker), System.currentTimeMillis());\r
+ mNotification.flags |= Notification.FLAG_ONGOING_EVENT;\r
+ mNotification.contentView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.progressbar_layout);\r
+ mNotification.contentView.setProgressBar(R.id.status_progress, 100, 0, download.getSize() == -1);\r
+ mNotification.contentView.setTextViewText(R.id.status_text, String.format(getString(R.string.downloader_download_in_progress_content), 0, new File(download.getLocalPath()).getName()));\r
+ mNotification.contentView.setImageViewResource(R.id.status_icon, R.drawable.icon);\r
+ // TODO put something smart in the contentIntent below\r
+ mNotification.contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);\r
+ mNotificationMngr.notify(R.string.downloader_download_in_progress_ticker, mNotification);\r
+ }\r