Thank you for your replies, but unfortunately it doesn´t work. If I open my app there´ll appear the error message:
The application has stopped unexpectedly. Please try again. Do you know what I have to do now? On 10 Mrz., 16:56, Dmitri Plotnikov <dplotni...@google.com> wrote: > Sorry, but the above answer is misleading. First of all, it uses obsolete > API. Second, it returns phone numbers, not birthdays. You should use the > Data.CONTENT_URI and constrain the mime type to Event. And then you should > do some magic about parsing dates, because we don't impose any format. So > it can be basically any string (exchange sync adapter is using a ISO > standard format, but gmail does not) > > Cheers, > Dmitri > > On Mar 10, 2010 12:41 AM, "SREEHARI" <sreehari.madhusooda...@wipro.com> > wrote: > > Use the below code to display all contacts with their number > > package com.wipro.address; > > import android.app.ListActivity; > import android.database.Cursor; > import android.os.Bundle; > import android.provider.Contacts.Phones; > import android.provider.Contacts.People; > import android.widget.ListAdapter; > import android.widget.SimpleCursorAdapter; > import android.net.Uri; > > public class Address extends ListActivity > { > public static Uri myURI = Uri.parse("content://homeprovider/ > homeprofiles"); > > �...@override > protected void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > > Cursor c = getContentResolver().query(Phones.CONTENT_URI, > null, null, null, null); > startManagingCursor(c); > 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); > > } > } > > -- > You received this message because you are subscribed to the Google > Groups "Android Dev... -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en