title: Android - update folder display after capture image
body: <p>I'm new to android. Now, i'm doing image capturing function using:</p>
  
  <pre><code>Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
  </code></pre>
  
  <p>The problem is after I capture my photo, the new captured photo does not display on the image display page.</p>
  
  <p>Does anyone here know where there is code that can help me refresh my android or any step that I need to do so that my image display page can be updated once I capture a new photo?</p>
  
  <p>Any help would be very appreciated and many thanks to you first. </p>
  
  <p>Updated answer:
  I use this, may be this can help others:</p>
  
  <pre><code>                mScanner = new MediaScannerConnection(
                  Camera.this,
                  new MediaScannerConnection.MediaScannerConnectionClient() {
                      public void onMediaScannerConnected() {
                          mScanner.scanFile(outputFileUri.getPath(), null /* mimeType */);
                      }
  
                      public void onScanCompleted(String path, Uri uri) {
                          //we can use the uri, to get the newly added image, but it will return path to full sized image
                          //e.g. content://media/external/images/media/7
                          //we can also update this path by replacing media by thumbnail to get the thumbnail
                          //because thumbnail path would be like content://media/external/images/thumbnail/7
                          //But the thumbnail is created after some delay by Android OS
                          //So you may not get the thumbnail. This is why I started new UI thread
                          //and it'll only run after the current thread completed.
                          if (path.equals(outputFileUri.getPath())) {
                              mScanner.disconnect();
                              //we need to create new UI thread because, we can't update our mail thread from here
                              //Both the thread will run one by one, see documentation of android  
                              Camera.this
                              .runOnUiThread(new Runnable() {
                                  public void run() {
  
                                  }
                              });
                          }
                      }
                  });
          mScanner.connect();
  </code></pre>