title: Android Studio App Edited images not showing up in gallery
body: <p>I created a simple android app for adding frames and cropping images, now after the editing is done the pictures are saved in android root>app folder but non of these pictures show up in the gallery, here is My code</p>
  
  <pre><code>    /**
       * Create a File for saving an image or video
       */
      private File getOutputMediaFile() {
          // To be safe, you should check that the SDCard is mounted
  
  //        File mediaStorageDir = new File(Environment.getExternalStorageDirectory()
  //                + "/Android/data"
  //                + getApplicationContext().getPackageName()
  //                + "/Files" + Global.AppFolder);
  
          File root = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "/" + Global.AppFolder);
  
  
          // Create the storage directory if it does not exist
          if (!root.exists()) {
              if (!root.mkdirs()) {
                  return null;
              }
          }
          // Create a media file name
          String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmm").format(new Date());
          File mediaFile;
          String mImageName = "MI_" + timeStamp + ".jpg";
          mediaFile = new File(root.getAbsolutePath(), mImageName);
          return mediaFile;
      }
  
      private String getRealPathFromURI(Uri uri) {
          Cursor cursor = getContentResolver().query(uri, null, null, null, null);
          if (cursor == null) {
              return uri.getPath();
          } else {
              cursor.moveToFirst();
              String s = cursor.getString(cursor.getColumnIndex("_data"));
              cursor.close();
              return s;
          }
      }
  </code></pre>
  
  <p>By the way I am a newbie and don't have a lot of experience with android coding so detailed answers and references(for further learning) shall be highly appreciated.</p>