使用我的应用程序+ xamarin android打开任何.jpg图像 [英] open any .jpg image using my application + xamarin android

查看:145
本文介绍了使用我的应用程序+ xamarin android打开任何.jpg图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种代码实现,可帮助我打开应用程序可以打开的设备的任何.jpg图像. 我希望我的应用程序在打开方式"列表中.

I am looking for a code implementation which help me to open any .jpg image of my device can be open by my application. I want my application in list of "open with".

推荐答案

我希望我的应用程序在打开方式"列表中.

I want my application in list of "open with".

您可以添加一个Intent过滤器(通过IntentFilterAttribute),该过滤器为该mime类型注册一个Activity.然后,您可以阅读Intent属性,以确定与应用程序共享的内容.

You can add an Intent Filter (via an IntentFilterAttribute) that registers an Activity for that mime type. Then you can read the Intent properties to determine what is being shared with your application.

[Activity(Label = "JPEG Viewer/Editor", MainLauncher = true, Icon = "@mipmap/icon")]
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "image/jpeg")]
public class MainActivity : Activity
{

     ~~~

}

这篇关于使用我的应用程序+ xamarin android打开任何.jpg图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆