Simply put, get sdcard pictures or video thumbnails do not say, many online, mainly write down the way to load pictures, in the Grideview adapter GetView () method defined:
Asynchronously loading a picture to achieve a single display
New Loadimageasyctask (gridviewhold. Icon). Execute (paths[position]);
class Loadimageasyctask extends asynctask<string, Void, bitmap>{
ImageView View;
Public Loadimageasyctask (ImageView view) {
Super ();
this. View = view;
}
@Override
protected Bitmap doinbackground (String ... params) {
TODO auto-generated Method stub
Bitmap Videoicon = Thumbnailutils.createvideothumbnail (
Params[0], video.thumbnails. mini_kind);
return Videoicon;
}
@Override
protected void OnPreExecute () {
TODO auto-generated Method stub
Super. OnPreExecute ();
}
@Override
protected void OnPostExecute (Bitmap result) {
TODO auto-generated Method stub
this. view. Setimagebitmap (Result);
Super. OnPostExecute (Result);
}
}