i added intent filter to my activity as below and my application is in list of Open With but what else i need to do to open that image in my application.
[IntentFilter(new string[] { Intent.ActionView }, Categories = new string[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "file", DataHost = "*", DataMimeType = "*/*", DataPathPattern = ".*\\\\.jpg")]
我在myactivity中添加了以下代码-onCreate()方法。
if (Intent.Action.Equals(Intent.ActionView))
{
TextView info;
info = FindViewById<TextView>(Resource.Id.textView);
if (Intent.Scheme.Equals(ContentResolver.SchemeFile))
{
Android.Net.Uri uri = Intent.Data;
//string name = uri.LastPathSegment;
Console.WriteLine(uri.Path + "~~~~~");
}
}
我也在这里获取uri路径,但下一步该怎么做。
非常感谢