分享布局

时间:2017-06-16 19:06:40

标签: android android-sharing

是否可以在某种布局中将数据(如音频文件)发送到WhatsApp等?类似于在WhatsApp上分享YouTube视频时获得的“布局”:

enter image description here

我现在想的是,这可能不是一个随数据发送的布局,但WhatsApp或其他应用程序识别YouTube链接并自行添加布局。这是对的吗?

目前我的共享音频文件的代码很常见,如下所示:

final String AUTHORITY = view.getContext().getPackageName() + ".fileprovider";

Uri contentUri = FileProvider.getUriForFile(view.getContext(), AUTHORITY, file);

final Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
shareIntent.setType("audio/mp3");
view.getContext().startActivity(Intent.createChooser(shareIntent, "Share sound via..."));

1 个答案:

答案 0 :(得分:1)

我不确定,但我不认为它有效。您可以通过WhatsApp发送文本。当你想通过WhatsApp发送文本时,这可能会有所帮助:https://faq.whatsapp.com/en/android/28000012
但整个布局或音频...我认为我们没有能力做到这一点。