You can use this method to create Thumbnail
private Bitmap getThumbnailBitmap(String file_name,String file_type)
{
try
{
String file_path= Environment.getExternalStorageDirectory()+File.separator+ Constants.APP_FOLDER_NAME+File.separator+ Constants.ATTACHMENTS_FOLDER_NAME+File.separator+file_name;
if(file_type.equals(Constants.FILE_TYPE_IMAGE))
{
int dimens=(int) Env.currentActivity.getResources().getDimension(R.dimen.thumbnailHW);
FileInputStream fis = new FileInputStream(file_path);
Bitmap imageBitmap = BitmapFactory.decodeStream(fis);
return ThumbnailUtils.extractThumbnail(imageBitmap, dimens, dimens);
}
else if(file_type.equals(Constants.FILE_TYPE_VIDEO))
{
return ThumbnailUtils.createVideoThumbnail(file_path, MediaStore.Video.Thumbnails.MICRO_KIND);
}
}catch (Exception e)
{
e.printStackTrace();
}
return null;
}