Nikunj Patel
Nikunj Patel

Reputation: 22066

Share Intent not give me an option

I am developing an app in which i would like to share my data through facebook,twitter,gmail,message or many more option which are provide by share intent do simply i have goto this code ..

     Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE );
    sharingIntent.setType("text/plain");
    String shareBody = "Here is the share content body";
    sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
    sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
    startActivity(Intent.createChooser(sharingIntent, "Share via"));

but here problem is when i am run an app it show only message screen (where to blah blah, type to compose and send button) ii cant give me those all option. so please help me out this...

Upvotes: 1

Views: 206

Answers (2)

K_Anas
K_Anas

Reputation: 31466

This snippet will fire all apps installed in your Emulator or your device wich are capable to send a content with a MIME type is text/plain.Since in your emulator/device is only the mail client you will get no others choices!!.

The technique described here can be used at startup time to ask the user whether he'd like to install the missing package, you can then simply redirect him to the Android Market by using the appropriate URI

Upvotes: 0

cjk
cjk

Reputation: 46425

If you are using the emulator, this is because message is the only app installed that can handle that type of share. You can only share to installed apps, I. E. If a twitter client isn't installed, you can't share to Twitter.

Upvotes: 2

Related Questions