0

im trying to Load a PreView of a Video inBackground of an ImageView at my ListAdapter, here i the code:

                Bitmap thumbnail =    
 ThumbnailUtils.createVideoThumbnail(file2.getAbsolutepath)
 ,MediaStore.Images.Thumbnails.MINI_KIND);

 BitmapDrawable bitmapDrawable = new 
 BitmapDrawable(mContext.getResources(),thumbnail);
        holder.PvideoView.setBackgroundDrawable(bitmapDrawable);
        Picasso.with(mContext).load(R.drawable.autumn_view).resize(PViewWidth,  
 PViewHeight).centerInside().into(holder.PvideoView);

but it returns this Exception:

  07-06 11:28:34.380: E/AndroidRuntime(6872): Process: com.lifemate.lmmessenger, 

  07-06 11:28:34.380: E/AndroidRuntime(6872): 
 java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
 07-06 11:28:34.380: E/AndroidRuntime(6872):    at 
 android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6724)
 07-06 11:28:34.380: E/AndroidRuntime(6872):    at 
 android.widget.ListView.layoutChildren(ListView.java:1589)
 07-06 11:28:34.380: E/AndroidRuntime(6872):    at 
 android.widget.AbsListView.onLayout(AbsListView.java:2091)
 07-06 11:28:34.380: E/AndroidRuntime(6872):    at 
 android.view.View.layout(View.java:14817)
 07-06 11:28:34.380: E/AndroidRuntime(6872):    at 
 android.view.ViewGroup.layout(ViewGroup.java:4631)
 07-06 11:28:34.380: E/AndroidRuntime(6872):    at  
 android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)

am i doing any thing wrong?

also i know that this method is depcerated, im using API 11, is there any replace ment for it in API 11?

 holder.PvideoView.setBackgroundDrawable(bitmapDrawable);

0 Answers0