samedi 3 janvier 2015

Image Name stored in SQLite (Android)

I am new to android and I facing issue while displaying image from SQLLite.


I am storing only image name (text) in SQLite database (column name IconName) and I want to display the image using cursor.


I am using following code to display image:



ImageView icon_pic = (ImageView) view.findViewById(R.id.icon);
icon_pic.setImageResource(cursor.getString(cursor.getColumnIndexOrThrow("IconName")));


As setImageResource is expecting integer value so I am not able to proceed further.


I have tried to find answer onstack overflow but unfortunately not able to find any suitable answer.Please provide any pointer that can help in resolving this issue.


Aucun commentaire:

Enregistrer un commentaire