Hm, I believe I'd had problems with that in a previous Android build, so I'm not certain, and I'd have to look at the chooser implementation across versions again to see.
I still sort of contend that this doesn't make sense: if your use case is for a SEND intent that doesn't fit with anyone else's mechanism, then why even use a SEND category? Why not just have your own custom intent, rather than have a confusing use of it? Am I misunderstanding: do you want to allow the user to share your information and also have other apps handle your information too? It seems that is not the case, meaning that a SEND intent is sort of inappropriate design here. Kris On Sun, Jan 13, 2013 at 3:39 PM, William Ferguson <[email protected]> wrote: > @Mark @Kristopher really? the doco for android:exported seems to indicate > that setting it to false will produce the precise behaviour I am looking > for. > http://developer.android.com/guide/topics/manifest/activity-element.html#exported > > And testing on a JellyBean device indicates that it is indeed so. The > Activity becomes available for selection via the IntentChooser when invoked > from within my app but is not visible when invoked from another app. > > What makes you think this is not the correct solution? > > > @Brion custom mime type won't cut it because I want the standard responders > to text/plain to also make themselves available. > @EveryoneElse if you are thinking BroadcastReceivers, LocalBroadcastManager > etc then you're on the wrong tangent, this is about starting an Activity. > > William > > > On Monday, January 14, 2013 4:16:56 AM UTC+10, Mark Murphy (a Commons Guy) > wrote: >> >> Please do not do this. It will not have the desired effect: it will >> show up in the chooser for all apps. And, if the user tries tapping on >> it from another app, that app crashes. >> >> The only solution for the OP's original requirement is to roll a >> custom chooser from scratch. >> >> On Sun, Jan 13, 2013 at 1:12 AM, Joman Chu <[email protected]> wrote: >> > Does android:exported=false do what you want? See >> > >> > http://developer.android.com/guide/topics/manifest/activity-element.html#exported >> > >> > >> > On Sun, Jan 13, 2013 at 12:38 AM, William Ferguson >> > <[email protected]> wrote: >> >> >> >> I have an Activity that responds to the ACTION_SEND Intent. Is there >> >> any >> >> way for me to be able to specify the IntentFilter such that the >> >> Activity is >> >> only displayed by the IntentChooser when it has been called from within >> >> my >> >> app? >> >> >> >> Ie I want the SendIntentResponderActivity displayed as a viable >> >> recipient >> >> of ACTION_SEND, but only if I am the one that issued the Intent. NB >> >> displaying my Activity shouldn't stop other standard responders (such >> >> as >> >> Gmail etc) from also being displayed. >> >> >> >>> <activity android:name=".SendIntentResponderActivity"> >> >>> <intent-filter> >> >>> <action android:name="android.intent.action.SEND"/> >> >>> <category android:name="android.intent.category.DEFAULT"/> >> >>> <data android:mimeType="text/plain"/> >> >>> </intent-filter> >> >>> </activity> >> >> >> >> >> >> >> >>> >> >>> final Intent shareIntent = new Intent(Intent.ACTION_SEND); >> >>> shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject); >> >>> shareIntent.putExtra(Intent.EXTRA_TEXT, content); >> >>> final Intent chooserIntent = Intent.createChooser(shareIntent, "Share >> >>> via")); >> >>> context.startActivity(chooserIntent); >> >> >> >> >> >> William >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups "Android Developers" group. >> >> To post to this group, send email to [email protected] >> >> To unsubscribe from this group, send email to >> >> [email protected] >> >> For more options, visit this group at >> >> http://groups.google.com/group/android-developers?hl=en >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Android Developers" group. >> > To post to this group, send email to [email protected] >> > To unsubscribe from this group, send email to >> > [email protected] >> > For more options, visit this group at >> > http://groups.google.com/group/android-developers?hl=en >> >> >> >> -- >> Mark Murphy (a Commons Guy) >> http://commonsware.com | http://github.com/commonsguy >> http://commonsware.com/blog | http://twitter.com/commonsguy >> >> Localized Android Question-and-Answer Sites: http://www.andglobe.com > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

