public class DownloadNotification extends Object
Constructor and Description |
---|
DownloadNotification(Context context) |
Modifier and Type | Method and Description |
---|---|
void |
completedDownload(String directoryPath,
String fileName)
Called when the downloading task is complete.
|
void |
createNotification(String fileName)
Creates an ongoing notification into the status bar
This notification will be updated while downloading with the percent downloaded
|
void |
eraseNotification(String fileName)
Called when the downloading task could not be completed
It removes the ongoing notification and creates a new static notification.
|
void |
progressUpdate(int percentageComplete)
Receives progress updates from the background task and updates the status bar notification appropriately
|
public DownloadNotification(Context context)
public void createNotification(String fileName)
fileName
- name of file that is downloading. It is show on the notification.public void progressUpdate(int percentageComplete)
percentageComplete
- public void completedDownload(String directoryPath, String fileName)
directoryPath
- directory where the downloaded file is storedfileName
- name of the just downloaded filepublic void eraseNotification(String fileName)