title: Failed to insert image requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
body: <p>i'm trying to implement sharing option into my application and to share images via different social networks, but i'm getting this error when i try to save image first from ImageView and then read it:</p>
  
  <pre><code>Failed to insert image java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri 
  content://media/external/images/media from pid=9758, uid=10176 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
  </code></pre>
  
  <p>This is my manifest file:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH"/&gt;
  &lt;uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  
  &lt;application
      android:name=".app.AppController"
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:largeHeap="true"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
  </code></pre>
  
  <p>And gradle file:</p>
  
  <pre><code>android {
  compileSdkVersion 23
  buildToolsVersion "23.0.2"
  
  defaultConfig {
      applicationId "com.dusandimitrijevic.pdssolution"
      minSdkVersion 15
      targetSdkVersion 23
      versionCode 3
      versionName "1.2"
  
      // Enabling multi dex support.
      multiDexEnabled true
  
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  </code></pre>
  
  <p>}</p>