本文介绍了从我的应用程序在 whatsapp 上分享视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想分享视频,当用户想要分享该视频时,我有该视频的链接并在应用程序中下载,
现在视频不在 whatsapp 上共享,我现在不知道如何,这是我的代码
我试过但没有奏效.
i want to Share video ,i have link of that and its downloaded in the app when user want to share that video,
now video is not shared on whatsapp i dont now how ,here is my code
which i tried but not worked.
Intent videoshare = new Intent(Intent.ACTION_SEND);
videoshare.setType("*/*");
videoshare.putExtra(Intent.EXTRA_STREAM, Uri.parse(Environment.DIRECTORY_DOWNLOADS+"/"+title));
videoshare.setPackage("com.whatsapp");
startActivity(Intent.createChooser(videoshare, "Share video"));
推荐答案
我终于找到了解决方案
public void shareVideoWhatsApp() {
Uri uri = Uri.fromFile(v);
Intent videoshare = new Intent(Intent.ACTION_SEND);
videoshare.setType("*/*");
videoshare.setPackage("com.whatsapp");
videoshare.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
videoshare.putExtra(Intent.EXTRA_STREAM,uri);
startActivity(videoshare);
}
这篇关于从我的应用程序在 whatsapp 上分享视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!