如何使用Intent通过WhatsApp共享视频时为视频添加标题

时间:2015-08-24 09:31:03

标签: android android-intent

我尝试在视频中添加文字(标题),我想分享:

public void shareVideoWhatsApp()
{
    Intent videoshare = new Intent(Intent.ACTION_SEND);
    videoshare.setType("*/*");

    String downloadurl = "Here comes the url";
    videoshare.putExtra(Intent.EXTRA_TEXT, downloadurl);

    videoshare.putExtra(Intent.EXTRA_STREAM, Uri.parse(StorageHandlerSDcard.getPath('v') + "/" + "video.mp4"));

    if(isPackageInstalled("com.whatsapp",this))
    {
        videoshare.setPackage("com.whatsapp");
        startActivity(Intent.createChooser(videoshare, "Share video and caption"));
    }
    else
    {
       Toast.makeText(getApplicationContext(), "Whatsapp is not installed!", Toast.LENGTH_LONG).show();
    }
}

视频是在没有标题的情况下共享的。您是否有任何想法通过WhatsApp和Intent同时分享视频和标题/文本?

0 个答案:

没有答案