机器人:以缩略图列表视图 [英] android:list view with thumbnail

查看:112
本文介绍了机器人:以缩略图列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建视频的列表视图与它缩略图images.The图像名来自database.I能给值TextView的,但是当试举值图像查看它也崩溃位图

I need to create the list view of video's with it thumbnail images.The image name come from the database.I can give value to textview but when try to give value to image view it crash also in bitmap

        class CustomSimpleCusorAdapter extends SimpleCursorAdapter{
    private Context context;
    private int layout;
    //TextView title;
    public CustomSimpleCusorAdapter(Context context, int layout, Cursor c,
            String[] from, int[] to) {

        super(context, layout, c, from, to);
        // TODO Auto-generated constructor stub
        this.layout=layout;
        this.context =context;

    }

public View newView(Context context, Cursor cursor, ViewGroup parent) {

     LayoutInflater inflater = LayoutInflater.from(context);
      View view = inflater.inflate(layout, parent, false);

     return view;
    }
@Override
public void bindView(View v, Context context, Cursor c) {

    Log.d("DATABAT",c.getString(c.getColumnIndexOrThrow(NotesDbAdapter.VIDEO_TITLE)));
    Log.d("DATABAT",c.getString(c.getColumnIndexOrThrow(NotesDbAdapter.VIDEO_IMAGE)));

    TextView section_text = (TextView) v.findViewById(R.id.title);
    section_text.setText(c.getString(c.getColumnIndexOrThrow(NotesDbAdapter.VIDEO_TITLE)));
    ImageView thumb =(ImageView)findViewById(R.id.icon);
  //         
    String filename = "flag_1";
      int id = context.getResources().getIdentifier(filename, "drawable", context.getString(R.string.package_str));
  Log.d("ID",""+id);

  thumb.setBackgroundResource(R.drawable.menuicon);

}

} 

感谢

推荐答案

好吧......踏着轻轻这里,不过这听起来酷似问题,试图显示他的视频的缩略图,当我哥们有应用程序...

Okay ... treading lightly here, but this sounds exactly like the problem my buddy had when trying to display the thumbnails for his videos app ...

下面是一个的恩code /德code教程的base64

和仅作参考;这里的市场上链接自己的应用程序(300,000下载)的视频播放器

And just for reference; here's the link to his app in the market (300,000+ downloads): Video Player

这篇关于机器人:以缩略图列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆