I’m using:
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("image/jpeg");
(...)
to share image generated in my app. I would like to add custom action (save image to gallery) to intent created by
Intent.createChooser(i, "...");
I was thinking about adding activity with intent-filter for android.intent.action.SEND action, but this will make my activity visible and available to all applications. I could change setType(“image/jpeg”) to setType(“image/*”) and add
<data android:mimeType="image/foobar">
to intent-filter, but this will make my activity visible to all applications that asks for image/*.
Is there any way to filter action visibility by caller package name (or something else, that could distinguish my application from other)?
Android has a nice solution for this requirement, the trick is
Intent.EXTRA_INITIAL_INTENTS: