我有一个具有不同声音的应用程序。我想与文本一起分享声音(音频)。
如果我只分享声音,它会起作用:
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(Environment.getExternalStorageDirectory().toString() + "/audio.mp3"));
share.setType("audio/mp3");
startActivity(Intent.createChooser(share, "Share via..."));
现在我尝试添加文本:
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(Environment.getExternalStorageDirectory().toString() + "/audio.mp3"));
share.setType("audio/mp3");
sharetext.putExtra(Intent.EXTRA_TEXT,"This should be under the audio file after sharing");
startActivity(Intent.createChooser(share, "Share via..."));
但仍然只有音频被共享。
它是如何工作的? 如果这不可能,还有其他方法吗? 非常感谢! :)
最佳答案
这实际上取决于您在使用选择器共享音频文件时最终选择的应用程序,因为由所选应用程序决定是否使用EXTRA_TEXT
设置的提供的文本。 。简而言之,您对此实际上没有太多控制权。
关于java - 一起分享音频和文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44834806/