How to force Share Intent to open a specific app?

Posted by AndroidUser99 on Stack Overflow See other posts from Stack Overflow or by AndroidUser99
Published on 2011-11-29T09:46:45Z Indexed on 2011/11/29 9:50 UTC
Read the original article Hit count: 206

Filed under:
|
|
|
|

I like share intent, it is perfect to open sharing apps with image and text parameters.

But now i'm researching the way to force share intent to open a specific app from the list, with the paramters given to the share intent.

This is my actual code, it shows the list of sharing apps installed on the phone. Please, can somedone tell me what i should add to the code to force for example official twitter app? and official faccebok app?

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.parse("file:///sdcard/test.jpg");  
sharingIntent.setType("image/*");
sharingIntent.putExtra(Intent.EXTRA_TEXT, "body text");
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(sharingIntent, "Share image using"));

Thanks

© Stack Overflow or respective owner

Related posts about android

Related posts about facebook