title: Android getting path to image from Thumbnail?
body: <p>I'm trying to ship a pivotal update to my app currently on the market. I need to query the thumbnails in the MediaStore, and load the the thumbnails into a GridView. So far so good, now I just need to get the path of the actual fullsized image on the user's External Storage based only on what I have(which is the path to the thumbnail). I need to be able to perform 4 actions whenever a user clicks a thumbnail, Share, View, Move and Delete...but I can't do any of these with just the thumbnail path, I've tried everything, doesn't work :/. Here's a snippet of my implementation below, any help or guidance on this would be greatly appreciated!</p>
  
  <pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {
  
      int columnIndex = 0;
      String[] projection = {MediaStore.Images.Media.DATA};
      Cursor cursor = managedQuery(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, null, null, null);
  
      if(cursor != null){
          columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
  
          cursor.moveToPosition(position);
          imagePath = cursor.getString(columnIndex);
  
          FileInputStream is = null;
          BufferedInputStream bis = null;
  
          try{
              is = new FileInputStream(new File(imagePath));
              bis = new BufferedInputStream(is);
              Bitmap bitmap = BitmapFactory.decodeStream(bis);
              useThisBitmap = Bitmap.createScaledBitmap(bitmap, parent.getWidth(), parent.getHeight(), true);
  
              bitmap.recycle();
          }catch(Exception e){
              //Try to recover
          }
          finally{
              try{
                  if(bis != null){
                      bis.close();
                  }
                  if(is != null){
                      is.close();
                  }
                  cursor.close();
                  projection = null;
              }catch(Exception e){
  
              }
          }
      }
      Toast.makeText(this, "  " + imagePath, Toast.LENGTH_SHORT).show();
  </code></pre>
  
  <p>So far I've tried everything using the imagePath member, but that either causes exceptions to be thrown or other errors. Any suggestions?</p>