@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]<javascript:>> 
> 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] <javascript:>> 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]<javascript:> 
> >> To unsubscribe from this group, send email to 
> >> [email protected] <javascript:> 
> >> 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]<javascript:> 
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:> 
> > 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

Reply via email to