gpt4 book ai didi

java - Android Studio 从共享 Intent 发送文本

转载 作者:行者123 更新时间:2023-12-02 04:48:01 26 4
gpt4 key购买 nike

大家好,我正在为类(class)开发 Android Studio 应用程序。我正在尝试使用 shareIntent 共享 ListView 中的文本。我有一个名为giftarray 的变量,它是一个String []

这是我在java中调用的方法

Public void intent (){ 

Intent sharingIntent = nee Intent (Intent.ACTION_SEND);

sharingIntent.setType ("text/html");
sharingIntent.putExtra (?????);
startActivity (Intent.createChooser (sharingIntent, "Share using"));


}

我应该在 .putExtra 中放入什么来将字符串 [] 发送到所选的共享应用程序。那么用户可以导出 ListView 吗?

最佳答案

下次尝试多查看一下,您会惊讶地发现已经问了这么多问题,而且您甚至可能不需要问就能找到您要找的东西。

无论如何,我建议您引用以下两个有关在 Activity 之间传递数组的问题:

  1. With use of Bundles

  2. Without use of a Bundle

关于java - Android Studio 从共享 Intent 发送文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29503896/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com