Can anyone help me; I'm just learning this Android, but get stuck with
this supposedly trivial query. It crashes, and I have no idea how to
fix it.

        ...
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            String[] projection = new String[] { People.NAME };

            Uri mContacts = People.CONTENT_URI ;

            // It's now 5 arguments rather than 4 as in tutorial...
            Cursor cursor = managedQuery( mContacts,
null,null,null,null);
            int n = cursor.getCount() ;

            TextView tv = new TextView(this);
            tv.setText("I have " + n + " records in my contact
database.");
            setContentView(tv);
        }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to