title: Android Insert Image / No such File or Directory /
body: <p>I'm trying to insert a picture from my directory "drawable" into my gallery but it does not work.</p>
  
  <pre><code>dataset1Image1=BitmapFactory.decodeResource(getResources(),R.drawable.dataset1soleil );
                  MediaStore.Images.Media.insertImage(getActivity().getContentResolver(), dataset1Image1,null, null);
  </code></pre>
  
  <p>I got this error :</p>
  
  <pre><code>Failed to insert image
      java.io.FileNotFoundException: No such file or directory
          at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:144)
          at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:621)
          at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1009)
          at android.content.ContentResolver.openOutputStream(ContentResolver.java:751)
          at android.content.ContentResolver.openOutputStream(ContentResolver.java:727)
          at android.provider.MediaStore$Images$Media.insertImage(MediaStore.java:995)
          at ***com.example.testbackup.ui.dataset1.Dataset1Fragment.createOnClicBtnEnreg(Dataset1Fragment.java:217)
          at com.example.testbackup.ui.dataset1.Dataset1Fragment.access$300(Dataset1Fragment.java:49)
          at com.example.testbackup.ui.dataset1.Dataset1Fragment$1.onClick(Dataset1Fragment.java:109)***
          at android.view.View.performClick(View.java:5721)
          at android.widget.TextView.performClick(TextView.java:10955)
          at android.view.View$PerformClick.run(View.java:22620)
          at android.os.Handler.handleCallback(Handler.java:739)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:148)
          at android.app.ActivityThread.main(ActivityThread.java:7331)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
  </code></pre>
  
  <p>Why is the file not found?</p>