2hamed
2hamed

Reputation: 9057

How to push my app into global share/send context menu in Android?

I have this need to place my app in the share/send context menu so that the user can pass a file path in (any) file manager apps to my application.
How is this achieved?

Upvotes: 0

Views: 333

Answers (1)

Nanne
Nanne

Reputation: 64409

The share context menu makes an INTENT with certain contents (type of data etc). You should register your app as being able to handle such an intent with an intent filter. You'll be automatically included if you choose the right type. You should read up on this:

To inform the system which implicit intents they can handle, activities, services, and broadcast receivers can have one or more intent filters. Each filter describes a capability of the component, a set of intents that the component is willing to receive. It, in effect, filters in intents of a desired type, while filtering out unwanted intents — but only unwanted implicit intents (those that don't name a target class). An explicit intent is always delivered to its target, no matter what it contains; the filter is not consulted. But an implicit intent is delivered to a component only if it can pass through one of the component's filters.

Read about it here: http://developer.android.com/guide/topics/intents/intents-filters.html

Upvotes: 2

Related Questions