lucasjordan wrote:
> It is my understanding that tasks like selecting a contact or an image
> on the phone is best implemented by asking the system to provide a
> view to perform the action. I tried the example in the documentation:
> 
> startActivityForResult(
>                  new Intent(Intent.ACTION_PICK,
>                  new Uri("content://contacts")),  //actually using
> Uri.parse("content://contacts");
>                  PICK_CONTACT_REQUEST);
> 
> but I get the following exception:
> 
> 08-31 17:42:59.752: ERROR/AndroidRuntime(190):
> android.content.ActivityNotFoundException: No Activity found to handle
> Intent { action=android.intent.action.PICK data=content://contacts }

I believe your Uri is incorrect. Try content://contacts/people and see 
if that works better.

> So, specifically,
> what is the correct URI to select a contact? 

See above.

> In general, is there a
> list someplace of expected views and how can I query  the system for
> available views.

That varies by what is all installed in Android. There are activities 
native to Android, activities that might be added by a mobile vendor or 
other form of Android "distro" (e.g., ApiDemos in the SDK emulator), and 
activities the user installs.

At best, there could be a list of what's available in the base Android 
OS, though I'm not sure such a list is available at this time. Though 
one might have been added in the 0.9 documentation that I haven't run 
across.

There are some introspection capabilities in Android, to find out what 
can be done with a Uri at runtime. However, those seem to have been 
seriously cut back in the 0.9 SDK from what was there in M5 -- there 
used to be ActivityAdapater and ActivityIconAdapter, which were wicked 
cool for this sort of thing. Right now, I think you are limited to 
Menu#addIntentOptions() and the underlying support provided by 
PackageManager#queryIntentActivityOptions().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!

--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to