Reputation: 52
I've implemented a AsyncTask
to download .pdf files to the storage. I was able to create a custom notification and I added a button to cancel that download.
However, now I have to use Android's own DownloadManager to handle the job. When I start download, it creates a notification showing the progress but I couldn't customize the notification to add a cancel button and run remove(long)
for it's onClick()
Since Google's apps uses downloadManager to download stuff and it has a button to cancel the download, there must be way to achieve.
Upvotes: 0
Views: 1104
Reputation: 591
Android N added the cancel option on notification when using Download Manager. There are some posts about it: link 1, link 2.
Upvotes: 1