Android 无法通过Intent向其他应用发送图像
我已将图像保存在SD卡上,然后尝试通过Intent将图像发送到其他应用程序。然而,当我尝试下面的代码时,其他应用程序没有收到图像,而且它们似乎正在崩溃。这里str1是SD卡上该映像的路径。我做错了什么?需要帮助吗 谢谢Android 无法通过Intent向其他应用发送图像,android,Android,我已将图像保存在SD卡上,然后尝试通过Intent将图像发送到其他应用程序。然而,当我尝试下面的代码时,其他应用程序没有收到图像,而且它们似乎正在崩溃。这里str1是SD卡上该映像的路径。我做错了什么?需要帮助吗 谢谢 通过将图像指定为jpeg,它有助于通过intent进行共享 shareIntent.setTypeimage/jpeg logcat中有什么?android.content.contentresolver.openInputStream,致命异常:SyncAdapterThrea
通过将图像指定为jpeg,它有助于通过intent进行共享
shareIntent.setTypeimage/jpeg logcat中有什么?android.content.contentresolver.openInputStream,致命异常:SyncAdapterThread如果以这种方式构造Uri会发生什么:Uri.FromFile1?
String str1 = file1.getAbsolutePath();
Intent shareIntent = new Intent();
shareIntent.setAction(android.content.Intent.ACTION_SEND);
shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(str1));
shareIntent.setType("image/jpg");
startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.share_image)));