2
このアプリケーションでは、ユーザーが任意の写真アプリケーションから画像を選択して共有するたびに、アプリケーションを共有アプリケーションのリストに表示することができます。 これは私がこの暗黙のアクションインテントを処理するためのものです。Xamarin Androidがactionsend MIMEタイプの暗黙のインテントを処理する
[IntentFilter(new string[] { Intent.ActionView },
Categories = new string[] { Intent.ActionDefault, Intent.CategoryBrowsable,
Intent.ActionSend, Intent.ActionSendMultiple },
DataScheme = "mimetype",
DataPathPattern = "*/*",
DataHost = "*.*")]
これは私が見つけたものである。このイメージまたは画像を処理するために、ここで
Intent intent = Intent;
String action = intent.Action;
String type = intent.Type;
if (Intent.ActionSend.Equals(action) && type != null)
{
if (type.StartsWith("image/"))
{
tv.Text = "single image sharable";
//handleSendImage(intent); // Handle single image being sent
}
}
else if (Intent.ActionSendMultiple.Equals(action) && type != null)
{
if (type.StartsWith("image/"))
{
tv.Text = "multiple images sharable";
//handleSendMultipleImages(intent); // Handle multiple images being sent
}
}
は、今私はギャラリーから画像を共有しようが、私は、リスト内の自分のアプリケーションが表示されません。 インテントフィルタで何かが間違っていなければなりません。単一または複数の画像を共有するための
記載されているインテントフィルタに、間違ったカテゴリが含まれています。 "Categories = new string [] {Intent.ActionDefault}"の代わりに、代わりにIntent.CategoryDefaultにする必要があります。 – kg743