Hi for android, thanks for your help, sorry, i need more directions on this question. Please have a look at the image attached, i want the icon placed to the left of each people item from Contact.
Thanks :) BR, Luke Wang Chevy Chase - "Parrots make great pets. They have more personality than goldfish." On Fri, Dec 12, 2008 at 5:59 PM, Luke w <[email protected]> wrote: > Please look at the image attached, i just want a List looks like that, but > it is not completed, i need the contact icon to placed to the left of each > item. what should i do? > > I want do this like the code below: > > ListAdapter adapter = new SimpleCursorAdapter(this, > R.layout.image_list, c, new String[] { Phones.NAME, > Phones.NUMBER, Phones._ID }, new int[] { R.id.name, > R.id.number, R.id.id }); > setListAdapter(adapter); > or, should i must extends a SimpleCursorAdapter ? If so, how to? please > give me some advice or some link to the tutorials. > Thanks very much. > > BR, > Luke Wang > > Robert Orben - "Older people shouldn't eat health food, they need all the > preservatives they can get." > > On Fri, Dec 12, 2008 at 12:42 PM, for android <[email protected]>wrote: > >> int pplId = managedCursor.getColumnIndex(People._ID); >> if (managedCursor.moveToFirst()) { >> >> do { >> id = managedCursor.getLong(pplId); >> >> Bitmap bitmap = People.loadContactPhoto(this, >> ContentUris >> .withAppendedId(People.CONTENT_URI, id), >> R.drawable.default_image, null); >> } while (managedCursor.moveToNext()); >> >> >> >> >> On Fri, Dec 12, 2008 at 9:05 AM, Luke w <[email protected]> wrote: >> >>> Anyone can help me to get the contact icons ? Help ~ >>> >>> BR, >>> Luke Wang >>> >>> >>> >>> On Thu, Dec 11, 2008 at 4:09 PM, Luke w <[email protected]> wrote: >>> >>>> Hi all, >>>> * >>>> now, my code below can display the name and major number about one of >>>> the contacts. * >>>> >>>> public class MainActivity extends ListActivity { >>>> >>>> @Override >>>> public void onCreate(Bundle savedInstanceState) { >>>> super.onCreate(savedInstanceState); >>>> Cursor c = getContentResolver().query(Phones.CONTENT_URI, null, >>>> null, >>>> null, null); >>>> startManagingCursor(c); >>>> // Map Cursor columns to views defined in simple_list_item_2.xml >>>> ListAdapter adapter = new SimpleCursorAdapter(this, >>>> android.R.layout.simple_list_item_2, c, new String[] { >>>> Phones.NAME, Phones.NUMBER }, new int[] { >>>> android.R.id.text1, android.R.id.text2 }); >>>> setListAdapter(adapter); >>>> } >>>> >>>> } >>>> >>>> *I want display a list of contacts like this :* >>>> >>>> |-------------------| >>>> icon name >>>> number >>>> |-------------------| >>>> icon name >>>> number >>>> |-------------------| >>>> *... >>>> ... >>>> could anybody, who familar with the Contact API, give me some hints on >>>> how to get the contact icon to satisfy the list above. * >>>> >>>> Thanks very much >>>> >>>> BR, >>>> Luke Wang >>> >>> >>> >>> >>> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---
<<inline: layout.GIF>>

