清单文件内加入intent-filter

                                                                                                                                                        

(在启动页内添加intent-filter)

                                                                            

android:scheme="android"    用来辨别启动的app
android:host="包名"           域名,建议使用应用的包名
android:pathPrefix="/open"  参数路径前缀

H5内使用

< a href="android://包名/open?type=1&id=1">进入XXXAPP内查看

 

在启动页onCreate()方法内获取intent

Intent intent = getIntent();        String action = intent.getAction();        String type= null;        String id = null;        if (Intent.ACTION_VIEW.equals(action)) {            Uri uri = intent.getData();            if (uri != null) {                type = uri.getQueryParameter("type");                id = uri.getQueryParameter("id ");            }            Toast.makeText(this,"你是从其他地方跳转进来的吗???",Toast.LENGTH_SHORT).show();        }

根据参数进行相应判断即可

 

本方法亲测有效(微信禁止scheme跳转,在浏览器内跳转有效

更多相关文章

  1. 浅谈Java中Collections.sort对List排序的两种方法
  2. mybatisplus的坑 insert标签insert into select无参数问题的解决
  3. Python技巧匿名函数、回调函数和高阶函数
  4. Python list sort方法的具体使用
  5. python list.sort()根据多个关键字排序的方法实现
  6. Failed to fetch URL http://dl-ssl.google.com/android/reposit
  7. Android(安卓)多线程----AsyncTask异步任务详解
  8. Android(安卓)Studio中获取SHA1或MD5的方法
  9. 如何在Android中启动JAVA程序

随机推荐

  1. /bin/repo: line 1: syntax error near u
  2. 【android】转载:实用Android开发工具和资
  3. Android(安卓)蓝牙4.0多蓝牙连接
  4. 如何向android的framework里添加新API
  5. Android编程心得-图片自适应心得
  6. [置顶] Android开发实战记录(三)---HelloWo
  7. android的json解析
  8. android excel读写
  9. android 的图形引擎 skia
  10. 【转】Android 加速度传感器 (G-Sensor)