title: Storage permission error in Marshmallow
body: <p>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: </p>
  
  <pre><code>Neither user  nor current process has android.permission.WRITE_EXTERNAL_STORAGE
  </code></pre>
  
  <p>It complains about this line of code: </p>
  
  <pre><code>DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
  manager.enqueue(request);
  </code></pre>
  
  <p>I have the permissions in the manifest outside application:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  </code></pre>
  
  <p>I cleaned and rebuilt the project, but it still crashes.</p>