Okay, didn't know that. But it doesn't explain the crash dump seen
from the Market. My code:
if (resultCode == Activity.RESULT_OK) {
Uri contactData = data.getData();
Cursor c = managedQuery(contactData, null, null, null,
null);
The relevant part of the NullPointerException crash:
Caused by: java.lang.NullPointerException
at
android.content.ContentResolver.acquireProvider(ContentResolver.java:
729)
at android.content.ContentResolver.query(ContentResolver.java:241)
at android.app.Activity.managedQuery(Activity.java:1520)
How is this possible?
On Oct 29, 7:03 am, Dmitri Plotnikov <[email protected]> wrote:
> Hitting the back button does call onActivityResult passing RESULT_CANCEL in
> the "result" arg.
> On Oct 28, 2010 7:06 PM, "Ron Schnell" <[email protected]> wrote:
>
>
>
>
>
>
>
> > I'm tracking down a crash dump for one of my applications.
>
> > I am using ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE as an
> > intent, to only list contacts with a phone number. In my
> > onActivityResult() for this intent, I check to make sure the result
> > code is RESULT_OKAY. But somehow when I use getData() on the data, it
> > is returning NULL. Obviously, I could do the proper error checking
> > here and not try to dereference the NULL (and will do that), but I'm
> > completely confused about how this could possibly return as NULL, and
> > want to make sure I don't lose functionality in the application.
>
> > As far as I can tell, the only way out of this intent is to pick a
> > contact, or use the "back" button, which would simply destroy it
> > without calling the onActivityResult().
>
> > What am I missing?
>
> > My application is for 2.0 and higher.
>
> > --
> > 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]<android-developers%2Bunsubs
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
--
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