我有我的音板的許多項目,我需要分享他們。我已經嘗試了本Android的份額ListView的內容
private void shareImage(int resId) {
Intent share = new Intent(Intent.ACTION_SEND);
// If you want to share a png image only, you can do:
// setType("image/png"); OR for jpeg: setType("image/jpeg");
share.setType("audio/mp3");
// Make sure you put example png image named myImage.png in your
// directory
String imagePath = "android.resource://com.example.app/" + resId;
File imageFileToShare = new File(imagePath);
Uri uri = Uri.fromFile(imageFileToShare);
share.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(share, "Share Image!"));
}
但沒有更迭!謝謝
什麼是您的實際問題?提供更多信息 – Libin
當我嘗試分享聲音時,例如WhatsApp,它說這是不可能的! – user3437592