首页 技术 正文
技术 2022年11月20日
0 收藏 470 点赞 3,854 浏览 1017 个字

1、在Android本地app清单文件里配置

<activity
android:name="com.mdj.ui.WelcomeActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- 通过uri呼起app -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="com.mdj.ui"
android:scheme="mdj" />
</intent-filter>
</activity>

注意:

schema必须都是小写字母。并且不能有数字

host也都是小写字母

2、编写一个简单的html页面

<html>
<head>
<title>Intent test</title>
</head>
<body>
<a href="mdj://com.mdj.ui">呼起app</a>
</body>
</html>

3、手机浏览器直接打开html

4、假设须要通过uri传參。直接改动html就可以

<html>
<head>
<title>Intent test</title>
</head>
<body>
<a href="mdj://com.mdj.ui/?arg0=0&arg1=1">呼起app</a>
</body>
</html>

5、在呼起的应用中获取

Uri uri = getIntent().getData();

String test1= uri.getQueryParameter("arg0");

String test2= uri.getQueryParameter("arg1");

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,075
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,551
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,399
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,176
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,811
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,893