假如当前播放的歌曲在手机中的路径为url = "storage/emulated/0/Music/温柔-五月天.mp3"
Intent sharedIntent = new Intent(); //创建分享Intent
sharedIntent.setAction(Intent.ACTION_SEND); //设置动作为Intent.ACTION_SEND
sharedIntent.setType("audio/*");
File file = new File(urli);
Uri uriShare = Uri.fromFile(file);
sharedIntent.putExtra(Intent.EXTRA_STREAM, uriShare );
startActivity(Intent.createChooser(sharedIntent, "分享到:"));
这样为什么不行???
Intent sharedIntent = new Intent(); //创建分享Intent
sharedIntent.setAction(Intent.ACTION_SEND); //设置动作为Intent.ACTION_SEND
sharedIntent.setType("audio/*");
File file = new File(urli);
Uri uriShare = Uri.fromFile(file);
sharedIntent.putExtra(Intent.EXTRA_STREAM, uriShare );
startActivity(Intent.createChooser(sharedIntent, "分享到:"));
这样为什么不行???