Android DownloadManager Cancel Button

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.

Answers


Android N added the cancel option on notification when using Download Manager. There are some posts about it: link 1, link 2.


Need Your Help

Build Errors using Xamarin and Visual Studio 2012

android visual-studio-2012 build installation xamarin

I'm trying to get Visual Studio 2012 running on Windows 8 and using Xamarin.