I am trying to display contact photos on my lazy adapter. I've put Photo_ID in an array list, I'm not sure how to display it on image view.
Here's what I did:
while (curly. Hilotonest ()) {string sid = cr.get string (cur.getColumnIndex (contactsContract.Contacts._ID) ); String name = cur.getString (cur.getColumnIndex (ContactsContract.Contacts.DISPLAY_NAME)); String photo = cur.getString (cur.getColumnIndex (ContactsContract.Contacts.PHOTO_ID)); Log.e ("photo" "," + photo); Hashmap & lt; String, string & gt; Map = new hashmap & lt; String, string & gt; (); Map.put ("name", name); Map.put ("id", syd); Map.put (photo "photo",); DetailsList.add (map); }} Cur.close (); Adapter = new contact name adapter (this, datalist); // update list view cl.setAdapter (adapter); } }
When the value of the picture is logged: I get Photo_ID # The adapter class I called is showing the name like this:
see public getView (int position, seeviewview, ViewGroup parent) {see vi = convertView; If (convertView == faucet) vi = inflater.inflate (R.layout.contacts_names_row, null); TextView name = (TextView) vi.findViewById (R.id.name); Name.setText (data.get (status) .Get ("name")); Return vi; } }
Am I stuck in displaying Photo ID from the adapter?
PHOTO_ID instead of PHOTO_URI or PHOTO_THUMBNAIL_URI . Then display it on an image view using your adapter. Reference:
No comments:
Post a Comment