Bushnaq, Ahmad wrote:
> In other words, to have a menu option available from the contacts app
> that my app puts in there that would invoke it?
With respect to the dialer, use the IPhone interface -- it offers dial()
and call() methods.
With respect to contacts, you need to craft the proper Intent to do what
you want. For example:
startSubActivity(new Intent(Intent.PICK_ACTION,
Uri.parse("content://contacts/people")), PICK_REQUEST);
This will bring up the contact selection activity, so the user can pick
a contact, with the selected contact's Uri being passed back to you via
onActivityResult().
The Intent option may work for the dialer too, with a 'tel:' prefix on
the phone number as the text representation of the Uri for the Intent,
but I haven't tried that.
> Please note that I've already seen this:
> _http://code.google.com/android/kb/commontasks.html#addmenuitems_ but
> that assumes the other app looks for your intent, and I haven't seen
> anything to say so for the contacts or dialer app.
Actually, the "Adding yourself to menus on other applications" on that
page covers another approach to your scenario. In your case, you are
what the page calls "the menu-displaying application". Given an Intent,
you can add to your options menu all the available things that can be
done on that Intent, by calling menu.addIntentOptions() as described.
--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ -- Available Now!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---