android - 如何将文件从我的应用程序发送到另一个支持共享数据的应用程序
问题描述
我实际上是在尝试将来自 API 的数据(作为文本而不是文件)发送给我,并且我想通过许多应用程序将这些数据作为文本文件发送,其中包括共享 WhatsApp、远足等文件,电报、shareit 等
解决方案
- 你能试试这个代码,看看它是否对你有用:
Intent shareIntent = new Intent("android.intent.action.SEND");
shareIntent.setType("text/plain");
shareIntent.putExtra("android.intent.extra.SUBJECT",
"Codes Easy");
shareIntent.putExtra("android.intent.extra.SUBJECT",
"Add a text to be shared here");
startActivity(Intent.createChooser(shareIntent, "Share with"));
推荐阅读
- sql - 在 Azure SQL DW 中生成 DDL 的选项
- sql-server - 如何在 SQL Server 中的 select 语句中为 XML 路径以外的列添加按子句排序
- python - 如何将 Json Gzip 文件从 S3 读取到列表中?
- javascript - 如何在 CSS 中使用通配符并将属性识别为自己的选择器
- c# - 检查一个值是否存在然后捕获另一个对象的值
- powershell - 用于块数据的 Powershell 拆分功能
- javascript - 设置 XHR 请求标头在 Node js 中运行后端两次
- python - 为什么对非 ASCII 字符串进行单字符切片比较慢?
- performance - Azure Sql 数据库 - 我如何判断是什么阻止了我的 IO
- java - scala.reflect.internal.MissingRequirementError:找不到编译器镜像中的对象 java.lang.Object。预测IO SETUP