balaji balaji - 1 year ago 63
Android Question

how to solve my video thumbnails? nothing display in my emulator screen

I am trying to display my video thumbnails, but my emulator displays an empty screen. I don't know where I'm making a mistake. I am trying to show these video thumbnails in my tab host.

This is my code:

public class video extends Activity {
//set constants for MediaStore to query, and show videos

//flag for which one is used for images selection
private GridView _gallery;

/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {

//set GridView for gallery
_gallery = (GridView)findViewById(;
//set default as external/sdcard uri

//set gallery adapter
private void setGalleryAdapter() {
_gallery.setAdapter(new VideoGalleryAdapter(this));

private class VideoGalleryAdapter extends BaseAdapter {

private Context mContext;

public VideoGalleryAdapter(Context c) {
mContext = c;

public int getCount() {
return tabview.videoList.size();

public Object getItem(int position) {
return null;

public long getItemId(int position) {
return 0;
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView;
if (convertView == null) { // if it's not recycled, initialize some attributes
imageView = new ImageView(mContext);
imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
imageView.setPadding(8, 8, 8, 8);
} else {
imageView = (ImageView) convertView;

Bitmap bitmap = BitmapFactory.decodeFile(tabview.videoList.get(position));
return imageView;


Answer Source

What is tabview.videoList? you might be getting null bitmaps from BitmapFactory.decodeFile, which is why you wouldn't see anything. has a good description of how to get video thumbnails.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download