如何在android中共享图像?
我已经在android系统中安装了Dropbox、Gmail plus。我读过这篇文章 我希望将我的图像共享到Dropbox或Gmail plus,我想下面的代码会弹出一个菜单,让我选择Dropbox、Gmail plus或其他应用程序来共享我的图像,但我得到一个提示信息:没有应用程序可以执行此操作。为什么?如何在android中共享图像?,android,Android,我已经在android系统中安装了Dropbox、Gmail plus。我读过这篇文章 我希望将我的图像共享到Dropbox或Gmail plus,我想下面的代码会弹出一个菜单,让我选择Dropbox、Gmail plus或其他应用程序来共享我的图像,但我得到一个提示信息:没有应用程序可以执行此操作。为什么? Intent intent = new Intent(Intent.ACTION_SEND); startActivity(Intent.createChooser(intent, "ti
Intent intent = new Intent(Intent.ACTION_SEND);
startActivity(Intent.createChooser(intent, "title");
因为您必须使用
intent.putExtra()
请阅读以下内容,因为您必须使用
intent.putExtra()
请阅读以下建议在图片应用程序中实施共享的更改: 在清单中,将其添加到要包含在菜单中的操作的筛选器中,当用户从标准操作栏点击时,该菜单将下拉:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
建议在图片应用程序中实施共享的2项更改: 在清单中,将其添加到要包含在菜单中的操作的筛选器中,当用户从标准操作栏点击时,该菜单将下拉:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>