Skip to content Skip to sidebar Skip to footer

How To Get Image From Drawable According To Their Names In The Sqlite Database And Then Display It In List View

i am creating an android application that use sqlite and images from drawable. what i need is to display the images existing in drawable folder according to their names in the sqli

Solution 1:

getIdentifier is ok, but you should use it this way:

int imageid = getResources().getIdentifier("brazil_flag", "drawable", context.getPackageName());

the first parameter is the name of the resource you are looking for, the second parameter is the type of the resource, the third is the package where to look for.

Post a Comment for "How To Get Image From Drawable According To Their Names In The Sqlite Database And Then Display It In List View"