【问题标题】:Android ACTION_SEND_MULTIPLE with video and text带有视频和文字的 Android ACTION_SEND_MULTIPLE
【发布时间】:2012-08-03 15:24:39
【问题描述】:

我正在尝试使用 ACTION_SEND_MULTIPLE Intent 同时共享视频文件和文本。

现在,这在 GMAIL 中有效(附件中的视频和邮件正文中的文本),但是我也想在 Whatsapp 中做同样的事情,但它没有出现在意图的应用程序列表中。

我的代码是下一个:

Intent sharingIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);

sharingIntent.putExtra(Intent.EXTRA_TEXT, "Descarga la app en...");

ArrayList<Uri> contenidos = new ArrayList<Uri>();

File file = new File(Environment
    .getExternalStorageDirectory()
    .getAbsolutePath()
    + "/Talking/"
    + nombreVideo
    + ".3gp");

Uri screenshotUri = Uri.fromFile(file);

contenidos.add(screenshotUri);

//sharingIntent.putExtra(Intent.EXTRA_STREAM,screenshotUri);
sharingIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, contenidos);
sharingIntent.setType("video/3gpp");

startActivity(Intent.createChooser(sharingIntent, "Share video using"));

感谢您的帮助。

【问题讨论】:

    标签: android video text android-intent share


    【解决方案1】:

    现在,由于 whatsapp 的新更新,您的代码可以正常工作,在此之前不接受这种意图 (ACTION_SEND_MULTIPLE),因为它一次只接受一个文件。

    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
    shareIntent.setType("image/png");    
    shareIntent.putExtra(android.content.Intent.EXTRA_STREAM,
        Uri.parse("file:///mnt/sdcard/UserImages/"+ ParseUser.getCurrentUser().getObjectId() + ".png"));    
    shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,"Hello test");    
    startActivity(Intent.createChooser(shareIntent,"Share"));  
    

    【讨论】:

      【解决方案2】:

      这可能意味着 Whatsapp 不支持这种意图 (ACTION_SEND_MULTIPLE)。

      【讨论】:

      • 没错。你没办法。 WhatsApp 选择一次只接受一个文件。
      猜你喜欢
      • 2011-07-27
      • 1970-01-01
      • 1970-01-01
      • 2013-05-02
      • 2011-05-31
      • 2014-04-28
      • 1970-01-01
      • 1970-01-01
      • 2013-01-26
      相关资源
      最近更新 更多