【发布时间】:2016-11-18 13:27:02
【问题描述】:
当我在自己的应用程序中尝试时,我只会得到文本(“签出...”)。 如何获取其余数据:图片、标题、描述和网站地址?
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
} else if (type.startsWith("image/")) {
handleSendImage(intent); // Handle single image being sent
}
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) {
if (type.startsWith("image/")) {
handleSendMultipleImages(intent);
}
}
我只收到带有 EXTRA_TEXT 的 ACTION_SEND。
【问题讨论】:
-
该图像是从您共享的链接中附加的。
-
@KirankumarZinzuvadia 所以我可以在后端对链接进行采样并手动创建?
标签: android share intentfilter android-sharing data-sharing