數據,我想分享的數據到我的應用程序在WhatsApp的一樣: 入門共享圖片和文字
當我在我自己的應用程序,我只得到文本(「退房嘗試它。 ..「)。 如何獲取其餘的數據:圖像,標題,描述和網站地址?
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所以我可以在後端採樣鏈接並手動創建? – user1787773