Listview Is Not Shows The Correct Images That Are In The Drawable According To Their Name In Sqlite
I have an android application that use sqlite as DB and fetch data from DB then display these data in the ListView. The problem is that it is not display the correct images accordi
Solution 1:
Instead of hard-coded text - brazil_flag
, write the name fetched from db. Like,
int imageid = context.getResources().getIdentifier(itemdetail.getFlag1(), "drawable", context.getPackageName());
ImageView imagenow = (ImageView) convertView.findViewById(R.id.imageView1);
imagenow.setImageResource(imageid);
Post a Comment for "Listview Is Not Shows The Correct Images That Are In The Drawable According To Their Name In Sqlite"