I'm tripping over bugs thick and fast at the moment, I must be doing more
work.
This one looks like such a fundamental bug that either my understanding is
completely erroneous, or its possible that no-one has ever written a
ContentProvider that calls setNotificationUri(). The latter is unthinkable,
so I'm posting here before logging a bug.
The following code-snippet throws a NPE:
Uri uri = new
Uri.Builder().scheme("content").authority("authority").appendPath("path").build();
uri.writeToParcel(Parcel.obtain(), 0);
It appears to be caused when the HierarchialUri implementation of Uri
assumes it has a query part that it then tries to write to a parcel. This
occurs in in both the 1.1 and 1.5 targets provided the new SDK. Indeed,
looking at the source, the code for android.net.Uri has barely changed.
This really should work, I can't see that it shouldn't, yet I tripped over
it when calling Cursor.setNotificationUri() within a call to
ContentProvider.query() which I anticipate is very common. Perhaps my
understanding of the parameters to setNotificationUri() is wrong, or perhaps
the implementation of the Uri passed to query() has changed and exposed this
bug, but I can't see how the latter could have escaped testing.
Can anyone shed light on this?
Tom.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---