Android上面通过URL来启动本地应用
2024-10-18 09:33:11
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.ingwill.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" /><!-- 显示数据 --> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /><!-- 定义成浏览器类型,有URL需要处理时会过滤 --> <data android:scheme="ingwill" /><!-- 打开以ingwill协议的URL,这个自己随便定义。 -->
</intent-filter>
</activity>
</application>
第二个intent-filter配置很重要,可以根据自己的需要单独配置一个activity作为调用界面,这里直接使用启动界面作为调用界面。
配置完成上面的intent-filter后在浏览器里面打开以ingwill://协议开头的URL时系统会调用本地支持ingwill协议的程序对ingwill://xxxxx URL进行处理。
最新文章
- GSD_WeiXin(高仿微信)应用源码
- ACM/ICPC 之 最小割转网络流(POJ3469)
- [转]Modernizr的介绍和使用
- Nginx 实现AJAX跨域请求
- POJ1699 Best Sequence(AC自动机+状压DP)
- ACM对时间掌控力和日积月累的习惯的意义
- apache/php 开启 gzip压缩
- 对iframe跨域通信的封装
- PHP多例模式
- bnuoj 4225 杨辉三角形(规律)
- Ecshop wap
- Google桌面搜索引擎
- Android实现获取应用程序相关信息列表的方法
- Html中截切文章内容,造成标签不全的问题
- WordPress非插件实现评论回复邮件提醒通知
- 如何理解Spring IOC
- CCF CSP 201703-1 分蛋糕
- Springboot配置时间格式
- Android的Databinding-资源绑定
- [51CTO]新说MySQL事务隔离级别!
热门文章
- editplus教程
- Dapper - .Net 环境下一个简单对象映射的框架
- ArcGIS10.6了解一下
- Android开发点滴 - 实现层级式导航(API 16+)
- jQuery.cookie应用操作
- Jenkins 持续集成综合实战
- JavaScript的valueOf和toString
- JVM类加载机制与对象的生命周期
- CentOS7 vsftp使用ftp客户端登录时不同的用户进入到不同的文件夹方法
- Spring MVC 通过 @PropertySource和@Value 来读取配置文件