title: Adding image to gallery in Android
body: <p>I have an app which does two things : </p>
  
  <ul>
  <li>it captures photo by camera app and saves it to gallery - and this works</li>
  <li>generates .gif out of images and saves it in <code>ExternalStoragePublicDirectory</code> - and this doesn't work</li>
  </ul>
  
  <p>This is the method I am using to add file to gallery : </p>
  
  <pre><code>public static void galleryAddPic(Context context, String currentPhotoPath) {
      Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
      File f = new File(currentPhotoPath);
      Uri contentUri = Uri.fromFile(f);
      mediaScanIntent.setData(contentUri);
      context.sendBroadcast(mediaScanIntent);
  }
  </code></pre>
  
  <p>I have read somewhere that this doesn't work on Android Api 19, can anybody confirm? 
  Is there any better solution for adding picture to gallery than my above method? 
  Cheers</p>