我在我的应用程序中有一个共享按钮,我想同时共享图像和文本.Gmail中工作正常,但在WhatsApp的,只有图像被发送和Facebook的应用程序崩溃.
我使用共享代码是这样的:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Message");
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/drawable/ford_focus_2014");
try {
InputStream stream = getContentResolver().openInputStream(uri);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
Run Code Online (Sandbox Code Playgroud)
如果我使用"shareIntent.setType("*/*")"Facebook和WhatsApp崩溃.
有办法做到这一点吗?也许同时发送两条消息(WhatsApp).
提前致谢.