Intent share = new Intent(Intent.ACTION_SEND);
share.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource://" + ContextID.getPackageName() + "/" + ResourceID));
share.setType("audio/*");
ContextID.startActivity(Intent.createChooser(share, "Condividi il suono"));
The above code works fine with Gmail, while Whatsapp gives a toast message like "Share a file failed, please try it again"
Maybe i've the same problem of this guy: Intent.ACTION_SEND Whatsapp
But how can i temporarily copy my resources on sd card and then share them?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…