This is a coherent behaviour – the method finds activities. The result also provides no information about the intent-filter that matched your intent. Meaning you only get one result per activity. However queryIntentActivityOptions() doesn’t find intent-filters, it finds activities with at least one matching intent-filter. Underneath it, this call uses PackageManager.queryIntentActivityOptions() to get the list of intents. I had hoped originally to use ContextMenu.addIntentOptions() to populate my context menus. However, there is no way to do this with the Android API to do this that I know of. It would be nice to be able to form a query which would find you both intent-filters so, for example, when a user bought up the context menu of a twitter user, you could show the Direct Message and Reply options. Assuming that our imaginary Twitter application uses the URI structure twitter-user://username to describe a user, putting the following into your AndroidManifest.xml would make sense: For example, within a Twitter application, when an imaginary ComposeTweetActivity is called for a twitter user, you may wish to either send a direct tweet to the user, or a reply to the user. When you think about it, this isn’t an uncommon scenario. But using this resolution, a single activity can’t consume a datatype in multiple ways.Īn application I’m working on has an activity that can consume a datatype in multiple ways. Android’s Intent resolution can find Activities to act on a datatype.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |