private Bitmap decodeThumbBitmapForFile(boolean isVideo,String path,int viewWidth,int viewHeight){
  if (isVideo) {
    Bitmap bitmap=null;
    bitmap=ThumbnailUtils.createVideoThumbnail(path,Thumbnails.FULL_SCREEN_KIND);
    bitmap=ThumbnailUtils.extractThumbnail(bitmap,viewWidth,viewHeight,ThumbnailUtils.OPTIONS_RECYCLE_INPUT);
    if (bitmap != null) {
      bitmap=Bitmap.createScaledBitmap(bitmap,viewWidth,viewHeight,false);
      return bitmap;
    }
    return null;
  }
 else {
    BitmapFactory.Options options=new BitmapFactory.Options();
    options.inJustDecodeBounds=true;
    BitmapFactory.decodeFile(path,options);
    options.inSampleSize=computeScale(options,viewWidth,viewHeight);
    options.inJustDecodeBounds=false;
    return BitmapFactory.decodeFile(path,options);
  }
}

private Bitmap decodeThumbBitmapForFile ( boolean isVideo , String path , int viewWidth , int viewHeight ) { if ( isVideo ) { Bitmap bitmap = null ; bitmap = ThumbnailUtils . createVideoThumbnail ( path , Thumbnails . FULL_SCREEN_KIND ) ; bitmap = ThumbnailUtils . extractThumbnail ( bitmap , viewWidth , viewHeight , ThumbnailUtils . OPTIONS_RECYCLE_INPUT ) ; if ( bitmap != null ) { bitmap = Bitmap . createScaledBitmap ( bitmap , viewWidth , viewHeight , false ) ; return bitmap ; } return null ; } else { BitmapFactory . Options options = new BitmapFactory . Options ( ) ; options . inJustDecodeBounds = true ; BitmapFactory . decodeFile ( path , options ) ; options . inSampleSize = computeScale ( options , viewWidth , viewHeight ) ; options . inJustDecodeBounds = false ; return BitmapFactory . decodeFile ( path , options ) ; } }
according view ( mainly imageview ) to get the width and height of the thumbnail pictures
