Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>u have to get the path or uri of the thumbnail to load it using universal image loader.</p> <p>see this to get the uri :-</p> <p><a href="https://stackoverflow.com/questions/5548645/get-thumbnail-uri-path-of-the-image-stored-in-sd-card-android">Get thumbnail Uri/path of the image stored in sd card + android</a></p> <p>i have also worked on same kind of project and hosted it over git-hub .. i have two versions of it one without ImageLoader and other with imageloader .. right now i have hosted only former one :-</p> <p>here is the path <a href="https://github.com/r4jiv007/CustomFilePicker.git" rel="nofollow noreferrer">https://github.com/r4jiv007/CustomFilePicker.git</a></p> <p>here is the method i used :-</p> <pre><code>private String getImageThumbnail(int id) { final String thumb_DATA = MediaStore.Images.Thumbnails.DATA; final String thumb_IMAGE_ID = MediaStore.Images.Thumbnails.IMAGE_ID; Uri uri = thumbUri; String[] projection = {thumb_DATA, thumb_IMAGE_ID}; String selection = thumb_IMAGE_ID + "=" + id + " AND " + MediaStore.Images.Thumbnails.KIND + "=" + MediaStore.Images.Thumbnails.MINI_KIND; Cursor thumbCursor = getContentResolver().query(uri, projection, selection, null, null); String thumbPath = null; Bitmap thumbBitmap = null; if (thumbCursor != null &amp;&amp; thumbCursor.getCount() &gt; 0) { thumbCursor.moveToFirst(); int thCulumnIndex = thumbCursor.getColumnIndex(thumb_DATA); thumbPath = thumbCursor.getString(thCulumnIndex); /* Toast.makeText(getApplicationContext(), thumbPath, Toast.LENGTH_LONG).show();*/ // thumbBitmap = BitmapFactory.decodeFile(thumbPath); } Log.i("ImageMiniKind", thumbPath + ""); return thumbPath; } </code></pre> <p>and u have to use :-</p> <pre><code> imageLoader.displayImage("file://" + fileX.getmThumbPath() + "", imageView, options); </code></pre> <p>for loading the image.. and also beware some times there is no thumbnail for images !!</p> <p>for loading thumbnail of video files </p> <pre><code>private String getVideoThumbnail(int id) { final String thumb_DATA = MediaStore.Video.Thumbnails.DATA; final String thumb_VIDEO_ID = MediaStore.Video.Thumbnails.VIDEO_ID; Uri uri = MediaStore.Video.Thumbnails.EXTERNAL_CONTENT_URI; String[] projection = {thumb_DATA, thumb_VIDEO_ID}; String selection = thumb_VIDEO_ID + "=" + id + " AND " + MediaStore.Video.Thumbnails.KIND + "=" + MediaStore.Video.Thumbnails.MINI_KIND; Cursor thumbCursor = getContentResolver().query(uri, projection, selection, null, null); String thumbPath = null; // Bitmap thumbBitmap = null; if (thumbCursor.moveToFirst()) { int thCulumnIndex = thumbCursor.getColumnIndex(thumb_DATA); thumbPath = thumbCursor.getString(thCulumnIndex); } return thumbPath; } </code></pre> <p>now all you have to do is pass the path to imageloader library </p>
 

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