In Lollipop, the download functionality works fine in my app, but when I upgraded to Marshmallow, my app crashes and gives this error when I try to download from the internet into the SD card: Neither user nor current process has android.permission.WRITE_EXTERNAL_STORAGE It complains about this line of code: DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); ma