清单文件内加入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. Android Studio中获取SHA1或MD5的方法
  2. [转]JS调用Android里面的方法,Android调用JS里面的方法
  3. Android中常用基本控件的使用方法和步骤(.txt)
  4. 3.6.3新版本AndroidStudio报Could not resolve all artifacts fo
  5. Android中Market的Loading效果实现方法
  6. android:TabHost使用方法
  7. Android的参数大致分成两块:系统服务参数和平台系统信息。
  8. Android内核开发:理解和掌握repo工具(含被墙后的下载方法)
  9. webapp打包为Android的apk包的一种方法

随机推荐

  1. redis事务,分布式锁
  2. redis位图
  3. HyperLogLog(不精确的去重计数方案)
  4. 插入排序,选择排序
  5. Sputnik:Airbnb基于Spark构建的数据开发框
  6. 女朋友问我:为什么会乱码?
  7. Spark SQL 中 Broadcast Join 一定比 Shu
  8. 我被喷上了热搜
  9. 单链表LRU
  10. 从网瘾少年逆袭拿到微软 、字节等offer(上