The app has an intent filter to allow it to appear in the share menu in other applications via ACTION_SEND intents. The app itself also has a share menu using ACTION_SEND and createChooser(), and my app appears in the list. Since they are already in my app it seems strange to have them be able to share back to itself.
Is there a way for my app not to appear in the list if it's being called from my app?
Here goes your solution. If you want to exclude your own app you can change "packageNameToExclude" with ctx.getPackageName()
Not via
createChooser()
. You can create your own chooser-like dialog viaPackageManager
andqueryIntentActivities()
and filter yourself out that way, though.You should use