title: The image's information and thumbnail are stored in different database?
body: <p>I use the following code to get thumbnail and fill them in gridView.<br>
  I guess that the image's information such <code>as BUCKET_DISPLAY_NAME,MediaStore.Images.Media.DATA and MediaStore.Images.Media._ID</code> are stored in a database,
  and the thumbnail of the image are stored in another database.</p>
  
  <p>So if I want to delete a image, I need to delete three parts, the one is physical file, the two is the record of the image's information in a database, and the three is the recodr of thumbnail in another database, right?<br>
  The following code  is only to delete two parts, the one is physical file, the two is the record of the image's information in a database. How can I delete the record of thumbnail? Thanks!</p>
  
  <p>BTW, the code </p>
  
  <blockquote>
    <p>sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
    Uri.parse("file://" +  Environment.getExternalStorageDirectory())));</p>
  </blockquote>
  
  <p>is not very good, because it's asynchronous, I need to get the latest thumbnails at once after I delete a image.  </p>
  
  <p>And more, will </p>
  
  <blockquote>
    <p>sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
    Uri.parse("file://" +  Environment.getExternalStorageDirectory())))</p>
  </blockquote>
  
  <p>update both the image's information database and thumbnails database ?</p>
  
  <pre><code>private void FillImageAndThumb() {
      this.count = curPublic.getCount();
      this.thumbnails = new Bitmap[this.count]; 
      this.arrPath = new String[this.count];
      this.thumbnailsselection = new boolean[this.count];
      this.myID=new int[this.count];
  
      for (int i = 0; i &lt; this.count; i++) {
          curPublic.moveToPosition(i);
          int id = curPublic.getInt(curPublic.getColumnIndex(MediaStore.Images.Media._ID));
          int dataColumnIndex =curPublic.getColumnIndex(MediaStore.Images.Media.DATA);
          myID[i]=id;
          thumbnails[i] = MediaStore.Images.Thumbnails.getThumbnail(
                            getApplicationContext().getContentResolver(), 
                            id,
                            MediaStore.Images.Thumbnails.MICRO_KIND, 
                            null);
          arrPath[i] = curPublic.getString(dataColumnIndex);
      }
  }   
  
  private void SetCurPublic(AdapterView&lt;?&gt; arg0,int index){
      String[] projection = new String[]{
              MediaStore.Images.Media._ID,
              MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
              MediaStore.Images.Media.DATA
      };
  
      Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
  
      if (index==0){
          curPublic = getContentResolver().query(
              images,
                  projection,
                  "",          
                  null,   
                  ""   
                  );
      }else{
          String s=arg0.getSelectedItem().toString();
          curPublic=  getContentResolver().query(
                  images,
                  projection,           
                  MediaStore.Images.Media.BUCKET_DISPLAY_NAME+"=?", 
                  new String[]{s},         
                  "" // Ordering
                  );
      } 
  }
  
  
  public void DeleteSelected() {
      for (int i = 0; i &lt; thumbnailsselection.length; i++) {
          if (thumbnailsselection[i]) {
              File fdelete = new File(arrPath[i]);
              if (fdelete.exists()) {
                  if (fdelete.delete()) {
                      Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                      String mSelectionClause = MediaStore.Images.Media._ID
                              + "=?";
                      String[] mSelectionArgs = { String.valueOf(myID[i]) };
                      getContentResolver().delete(
                              images,
                              mSelectionClause, 
                              mSelectionArgs
                              );
                  }
              }
          }
      }
  }    
  </code></pre>