【发布时间】:2017-11-22 12:15:49
【问题描述】:
我需要启用我的应用程序以提取 zip 文件,并且我想在从设备中单击(选择)一个 zip 文件时打开我的应用程序。 在查看 like this 和 this 的一些帖子后,我已经创建和 IntentFilter
[Activity(Label ="Zip")]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[] { Intent.CategoryDefault },
DataScheme ="file",
DataHost ="*",
DataPathPattern = "*\\.zip",
DataMimeType = "application/zip"
DataPathPattern = "*\\.zip",
DataMimeType = "application/zip"
)]
活动代码在这里:
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var uri = Intent.Data.Path;
Toast.MakeText(this, uri, ToastLength.Long);
}
问题:当我选择 zip 文件时,我的应用程序没有启动。 参考文档:https://developer.android.com/guide/topics/manifest/data-element.html
【问题讨论】:
-
还有什么问题?
-
当我选择 zip 文件时,我的应用没有启动。
-
来自链接的答案 - 我看到您没有添加
<data android:scheme="file" />的 Xamarin 模拟 -
也是
<data android:host="*" /> -
我已经更新了问题,以问题为准。
标签: android xamarin.android intentfilter