In your Android Manifest file, you need to configure explicit permissions for your application to read the Contacts database. In Eclipse, you can do this easily,, just click around with the AndroidManifest file.
- p On Dec 26, 10:28 am, "Sarath Kamisetty" <sarath.kamise...@gmail.com> wrote: > Hi, > > I am trying to write a simple application that displays the contents > of Contacts content provider in the phone. So far, I have only one > statement in this program (pasted below) and all it does is tries to > get a cursor over the contacts list. However, when I run the > application in the emulator, I see the following run time error on the > emulator screen: > > "Sorry! The application MyApp (process com.android.myapp) has stopped > unexpectedly. Please try again." > > How do I start debugging this ? Is there any debugger that can help ? > Any logs that I can look at ? Here is my test application. > > Thanks, > Sarath > > import android.app.Activity; > import android.database.Cursor; > import android.os.Bundle; > import android.provider.Contacts.People; > > public class MyApp extends Activity { > // array specifying which columns to return. > private String[] projection = new String[] { > People._ID, > People.NAME, > People.NUMBER, > }; > Cursor managedCursor; > > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > > managedCursor = managedQuery(People.CONTENT_URI, > projection, > null, > null, > People.NAME + " ASC"); > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---