Мне нужно создать представление списка видео с миниатюрными изображениями. Название изображения берется из базы данных. Я могу дать значение для просмотра текста, но при попытке задать значение для просмотра изображения происходит сбой также в растровом изображении
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);
}
}
Спасибо