我正在寻找一种方法,使我的用户能够发送图片到我的应用程序通过分享(在android上)。
我现在的主要目标是让我的应用程序在按下图库中的分享按钮时出现在“分享到”选项卡上,并存储共享的图片(或指向图片的链接)。
发布于 2018-07-29 19:10:34
我已经用android工作室找到了答案,而不是xamarin,因为它给我带来了很多问题。如果你自己有同样的问题,你应该遵循Arvindraja的答案,请不要他的答案只会使您的应用程序出现在共享菜单中,但您将共享到它的数据不会被保存在任何地方,因为您将需要额外的代码。
发布于 2018-07-27 14:27:56
要让你的项目在共享列表中,你需要操作你的menifest文件
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MyActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
</application>
在这些链接中,您可能会以更精确的方式获取内容。祝好运。
https://stackoverflow.com/questions/51556376
复制