this Manifest’s code will allow my activity to capture any text data that were shared by any app:
<intent-filter
android:label="my_label">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
I want my activity to capture the shares that comes from Twitter official app ONLY. I want it to appear only in the share list of Twitter app.
Is this possible?
Generally speaking, there is no way for an
<intent-filter>to say “no, I only want to work with XYZ app”. The only things that you could use for that sort of thing would be:custom permissions, where Twitter would have to modify their apps with a
<uses-permission>element for your custom permissioncustom permissions, set to
android:protectionLevel="signature", which would require Twitter to sign their apps with your signing keya custom category, or some other proprietary tweak to their
ACTION_SENDIntent, which would have the side effect of breaking everyone else for your benefitNone of those seem likely.