Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在whatsapp上共享音频。。它不起作用_Java_Android - Fatal编程技术网

Java 如何在whatsapp上共享音频。。它不起作用

Java 如何在whatsapp上共享音频。。它不起作用,java,android,Java,Android,如何在WhatsApp上共享音频?这是我的代码: Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("audio/mp3"); shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(dialog_audio)); context.startActivity(Intent.creat

如何在WhatsApp上共享音频?这是我的代码:

 Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
 shareIntent.setType("audio/mp3");
 shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(dialog_audio));
 context.startActivity(Intent.createChooser(shareIntent, "mp3 shared!"));`
尝试添加这一行

shareIntent.setPackage("com.whatsapp");
记住要得到许可

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

它不工作..错误-“共享失败,请重试”它不工作是什么意思?你的实际症状是什么?
dialog\u audio
?String dialog\u audio=detailDatalist\u model.getPost\u audio()的值是多少;音频url的位置。