Note that this only works with applications that want to participate in the mechanism, and pretty much none of the built-in applications do this. We moved away from this approach because managing the UI for an arbitrary number of additional items is a challenge. Our preference these days is for the application to start a chooser activity from which the user can select what they want to do; see the Intent docs for info on this.
2008/11/18 Adrian A <[EMAIL PROTECTED]> > > Hi Michael, > > Have you had any luck with this? What was the problem you had? > > Many thanks in advance, > Adrian > > On Oct 21, 4:31 am, Shade <[EMAIL PROTECTED]> wrote: > > Hello! > > > > If you mean Android Howto document: > > > > Adding yourself to menus on other applications > > > > You can also advertise your Activity's services so that > otherActivitiescan add your activity to their own optionmenu. For > > example, suppose you implement a new image handling tool that shrinks > > an image to a smaller size and you would like to offer this as amenu > > option to any other Activity that handles pictures. To do this, you > > would exposes your capabilities inside an intent filter in your > > manifest. If another application that handles photos asks Android for > > anyActivitiesthat can perform actions on pictures, Android will > > perform intent resolution, find your Activity, and add it to the other > > Activity's optionsmenu. > > The offering application > > > > The application offering the service must include an <intent-filter> > > element in the manifest, inside the <activity> tag of the offering > > Activity. The intent filter includes all the details describing what > > it can do, such as a <type> element that describes the MIME type of > > data that it can handle, a custom <action> value that describes what > > your handling application can do (this is so that when it receives the > > Intent on opening it knows what it is expected to do), and most > > important, include a <category> filter with the value > > android.intent.category.ALTERNATIVEand/or > > android.intent.category.SELECTED_ALTERNATIVE (SELECTED_ALTERNATIVE is > > used to handle only the currently selected element on the screen, > > rather than the whole Activity intent. > > > > Here's an example of a snip of a manifest that advertises picture > > shrinking technology for both selected items and the whole screen. > > <activity class="PictureShrink"> <!-- Handling class -- > > > > <intent-filter label="Shrink picture"> <!--Menulabel to > > display --> > > <action android:name="com.example.sampleapp.SHRINK_IT" /> > > <data android:name="image/*" /> <!-- MIME type > > for generic images --> > > <category android:name="android.intent.category.ALTERNATIVE" / > > > > <category > > android:name="android.intent.category.SELECTED_ALTERNATIVE" /> > > </intent-filter> > > </activity> > > > > I've tried it. > > After adding that intent-filter (with fixed typos) Pictures > > application still does not offer to shrink pictures. > > > > <intent-filter label="Do something terrible"> > > <action android:name="android.intent.action.VIEW" /> > > <data android:scheme="http" /> > > <category android:name="android.intent.category.ALTERNATIVE" /> > > <category > > android:name="android.intent.category.SELECTED_ALTERNATIVE" /> > > </intent-filter> > > Adding this to my manifest does not affect browser'smenutoo. > > > > Maybe i am making something wrong but i don't know what. And i was > > unable to find really workingexamplesof such actions. > > > > With respect, > > Michael > > PrinterShare team > > > > PS SDK version 1.0_r1 > > > > On 21 окт, 13:10, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > > I'm sorry i d'ont have example > > > > > But you can find tutorial on code.google.com/android > > > > > good luck. > > > > > On 17 oct, 16:59, Shade <[EMAIL PROTECTED]> wrote: > > > > > > Hello! > > > > It is possible to add my activity to build-in browser'smenu? > > > > Working example wanted. > > > > > > Thank you. > > > > > > With respect, > > > > Michael > > > > PrinterShare team > > > -- Dianne Hackborn [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

