I want to share the content from my application to other applications. I've used the below code for this
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, title);
intent.putExtra(Intent.EXTRA_TEXT, linkUrl);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
((Activity) mContext).startActivityForResult(
Intent.createChooser(intent, mContext.getString(R.string.share_via) + "…"), ConstantVariables.CONTENT_SHARING_CODE)
I've also defined the below intent filter in my application's manifest file.
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
So, whenever I share any content from my application, an application chooser appears which lists all the apps which can receive this content. In this listing, my application is also getting listed but I don't want to list my application when I share any content from my app itself.
Can someone please help, how can I achieve this.
Thanks a lot in advanced.