Reputation: 4306
I'm populating a list from the DB, and i have a image field in the DB which contains a URL to a image file.
ListAdapter adapter=new SimpleCursorAdapter(this,
R.layout.row, constantsCursor,
new String[] {"title", "subtitle", "image"},
new int[] {R.id.value, R.id.title, R.id.icon});
However, the other fields are populated, but the image remains empty. Why?
Upvotes: 1
Views: 621
Reputation: 4612
getContentResolver().openInputStream()
this is how,for example, you retrieve contact's images, you query the contact's details for the image uri and then open the input stream the way i showed you. to do it using the simple cursor adapter, if that's the case here, you also need to implement ViewBinder so when the cursor adapter sees the uri it will know to retrieve the data and put it in the view.Upvotes: 1