0

I'm trying ti use DownloadManager class in my app to download a file from a url.

DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
    dm = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
    enqueue = dm.enqueue(request);

this code produces:

Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.downloads.DownloadProvider from ProcessRecord{4099d440 5576:com.digitalaria.gama.sample.carousel/10134} (pid=5576, uid=10134) requires android.permission.ACCESS_ALL_DOWNLOADS or android.permission.ACCESS_ALL_DOWNLOADS

how to solve the problem?

Soheil
  • 1,676
  • 7
  • 34
  • 65
  • Check this link first http://stackoverflow.com/questions/14364091/retrieve-file-path-from-caught-downloadmanager-intent. – Piyush Jan 30 '15 at 10:32

1 Answers1

3

What version of Android are you trying to run that on ? Have a look at this :

https://code.google.com/p/android/issues/detail?id=13043

Providing INTERNET and WRITE_EXTERNAL_STORAGE permissions should take care of it.

Adnan Mulla
  • 2,872
  • 3
  • 25
  • 35