这是我的代码:
private class DownloadFilesTask extends AsyncTask<String, Integer, Bitmap> {
Bitmap thumbnail;
ImageView imageView;
public DownloadFilesTask(ImageView iv) {
super();
imageView = iv;
}
protected Bitmap doInBackground(String... urls) {
return ThumbnailUtils.createVideoThumbnail( urls[0], MediaStore.Video.Thumbnails.MINI_KIND );
}
protected void onPostExecute(Bitmap result) {
imageView.setImageBitmap(result);
}
}
我这样使用它......
new DownloadFilesTask(holder.imageView).execute("http://192.168.0.3/videoone.mp4");
每次onPostExecute发生时,位图结果为空。有什么想法吗?