共享音频和文字



我有一个带有不同声音的应用。我想和文字共享声音(音频(。

如果我只共享声音,它有效:

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..."));

,但仍然只有音频共享。

它是如何工作的?如果不可能,还有其他方法可以做到吗?非常感谢!:(

这实际上取决于您最终选择哪个应用程序在使用chooser共享音频文件时选择的应用程序,因为它可以决定是否使用提供的文本由EXTRA_TEXT设置。简而言之,您确实对此没有太多控制。

最新更新