Soheil
Soheil

Reputation: 1706

android-strange behavior of Intent.ACTION_SEND

I'm using a piece of code to make the user able to share musics of my app via different apps like Viber, Whatsapp, Gmail and... .

        Uri theUri = Uri.parse(CopyAssets(
            SHARE));
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("audio/*");
    intent.putExtra(Intent.EXTRA_STREAM, theUri);
    startActivity(intent);

but it doesn't bring up a full list of those apps. fore example I can't see Viber in the list, but WhatsApp is in the list. whats wrong with my code?

Upvotes: 0

Views: 87

Answers (1)

Sam Bains
Sam Bains

Reputation: 548

There is nothing wrong with your code. You are telling Android I want all apps that support the MIME type "audio/*".

It is up to other apps to tell Android that "I support this type". If they do, they will appear (like WhatsApp does), but if they do not (in the case of Viber) then they will not appear in the list.

Take a look here http://developer.android.com/training/sharing/send.html

Upvotes: 2

Related Questions