Note that there are some explanatory texts on larger screens.

plurals
  1. POGet thumbnail Uri/path of the image stored in sd card + android
    primarykey
    data
    text
    <p><strong>SDK version - 1.6</strong></p> <p>I am using following intent to open android's default gallery:</p> <pre><code>Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult( Intent.createChooser(intent, "Select Picture"), 101); </code></pre> <p>Now in <code>onActivityResult</code>, i am able to get the original Uri and path of the selected image, but i am not able to get the Uri and path of the thumbnail of selected image.</p> <p>Code for getting the original image Uri and path:</p> <pre><code>@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { if (requestCode == 101 &amp;&amp; data != null) { Uri selectedImageUri = data.getData(); String selectedImagePath = getPath(selectedImageUri); } else { Toast toast = Toast.makeText(this, "No Image is selected.", Toast.LENGTH_LONG); toast.show(); } } catch (Exception e) { e.printStackTrace(); } } public String getPath(Uri uri) { String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(uri, projection, null, null, null); int column_index = cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } </code></pre> <p>PS: 1) i am not looking to resize image like this <a href="https://stackoverflow.com/questions/4916159/android-get-thumbnail-of-image-on-sd-card-given-uri-of-original-image">question</a>. I am specifically looking for the thumbnails which are generated by android OS itself.</p> <p>2) Using SDK version 1.6 so not interested in <a href="http://developer.android.com/reference/android/media/ThumbnailUtils.html" rel="nofollow noreferrer">ThumbnailUtils</a> class.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload