Android studio 通过共享意图发送文本
Android studio send text from share intent
大家好,我正在为 class 开发 android 工作室应用程序。我正在尝试使用 shareIntent 从列表视图中共享文本。
我有一个名为 giftarray 的变量,它是一个字符串 []
这是我在 java
中调用的方法
Public void intent (){
Intent sharingIntent = nee Intent (Intent.ACTION_SEND);
sharingIntent.setType ("text/html");
sharingIntent.putExtra (?????);
startActivity (Intent.createChooser (sharingIntent, "Share using"));
}
我要在 .putExtra 中输入什么才能将字符串 [] 发送到所选的任何共享应用程序。所以用户可以导出列表视图?
下次尝试多浏览一下 SO,您会惊讶于已经问了多少问题,您可能甚至不用问就能找到您要找的东西。
无论如何,我建议您参考这两个关于在活动之间传递数组的 SO 问题:
With use of Bundles
Without use of a Bundle
大家好,我正在为 class 开发 android 工作室应用程序。我正在尝试使用 shareIntent 从列表视图中共享文本。 我有一个名为 giftarray 的变量,它是一个字符串 []
这是我在 java
中调用的方法Public void intent (){
Intent sharingIntent = nee Intent (Intent.ACTION_SEND);
sharingIntent.setType ("text/html");
sharingIntent.putExtra (?????);
startActivity (Intent.createChooser (sharingIntent, "Share using"));
}
我要在 .putExtra 中输入什么才能将字符串 [] 发送到所选的任何共享应用程序。所以用户可以导出列表视图?
下次尝试多浏览一下 SO,您会惊讶于已经问了多少问题,您可能甚至不用问就能找到您要找的东西。
无论如何,我建议您参考这两个关于在活动之间传递数组的 SO 问题:
With use of Bundles
Without use of a Bundle