+ /// notify result\r
+ mNotificationMngr.cancel(R.string.downloader_download_in_progress_ticker);\r
+ int tickerId = (downloadResult) ? R.string.downloader_download_succeed_ticker : R.string.downloader_download_failed_ticker;\r
+ int contentId = (downloadResult) ? R.string.downloader_download_succeed_content : R.string.downloader_download_failed_content;\r
+ Notification finalNotification = new Notification(R.drawable.icon, getString(tickerId), System.currentTimeMillis());\r
+ finalNotification.flags |= Notification.FLAG_AUTO_CANCEL;\r
+ // dvelasco ; contentIntent MUST be assigned to avoid app crashes in versions previous to Android 4.x ;\r
+ // BUT an empty Intent is not a very elegant solution; something smart should happen when a user 'clicks' on a download in the notification bar\r
+ finalNotification.contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);\r
+ finalNotification.setLatestEventInfo(getApplicationContext(), getString(tickerId), String.format(getString(contentId), tmpFile.getName()), finalNotification.contentIntent);\r
+ mNotificationMngr.notify(tickerId, finalNotification);\r
+ \r
+ sendFinalBroadcast(downloadResult, (downloadResult)?newFile.getAbsolutePath():null);\r