This is just a short review to give you a few keywords.
First of all, how to create a notification should be fairly simple and well documented. If you do not know how to create a normal notification, check out Status line notification .
The next step is to create a notification with a custom layout containing the ProgressBar (since there is no ready layout for this afaik), which is also documented on the page . Having created an instance of Notification for this, you must save the link and use it to update the ProgressBar through
notification.contentView.setProgressBar(R.id.yourprogressbar, 100, 42, false); nm.notify(notificationId, notification);
nm is a NotificationManager link here, also see RemoteViews.setProgressBar ()
This is basically the UI side of things. To download a file in the background, you must use a Service that uses AsyncTask (since services run in a UI thread - the name is often misleading). You can use AsyncTask.publishProgress() to send progress updates to the user interface and update the progress bar inside AsyncTask.onProgressUpdate() .
user658042
source share