Android 从一个应用跳转到另外一个应用
来源:互联网 发布:python数据挖掘包 编辑:程序博客网 时间:2024/05/20 16:37
公司自主研发的项目。需要相互关联,资源共享,就需要应用的项目跳转,其实很简单,方法也有很多。
方法一:
try { PackageManager packageManager = getPackageManager(); Intent intent= new Intent(); intent = packageManager.getLaunchIntentForPackage("自己项目的applicationId"); startActivity(intent);} catch (Exception e) { Toast.makeText(SystemUtil.getApplication(),"请到应用市场下载该应用",Toast.LENGTH_SHORT).show(); e.printStackTrace();}
法法二:
自己项目的applicationId
com.cccollector.magazine.shoucangtouzidaokan.android
try {//com.cccollector.magazine.shoucangtouzidaokan.android Intent intent = new Intent(); intent.setAction("com.cccollector.magazine"); //模糊跳转 intent.addCategory("shoucangtouzidaokan"); //精确跳转 startActivity(intent); } catch (Exception e) { //没有此应用 // Toast.makeText(this, "检查到您手机没有安装此应用,请安装后使用该功能", Toast.LENGTH_LONG).show(); //跳转到下载 pkgname就是applicationId Intent it = new Intent(Intent.ACTION_VIEW, Uri.parse("http://a.app.qq.com/o/simple.jsp?pkgname=com.cccollector.magazine.shoucangtouzidaokan.android" )); startActivity(it); }
清单文件配置
在启动的Activity里面配置如下参数。
<activity android:name=".MainActivity"<!--对外的隐式跳转--> android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <!--对外的隐式跳转action category DEFAULT必须有--> <action android:name="com.cccollector.magazine"/> <category android:name="shoucangtouzidaokan"/> </intent-filter></activity>
阅读全文
0 0
- Android 从一个应用跳转到另外一个应用
- Android 从一个应用跳转到另外一个应用中的问题
- Android一个应用跳转另外一个应用
- android从一个应用跳转到另一个应用
- android 中从一个activity 跳转到另外一个activity
- 从一个应用进入另外一个应用
- Activity跳转到另外一个应用的Activity
- android如何从一个应用跳转到另一个页面
- Android中从service中向另外一个应用包跳转的问题
- Android 一个应用启动另外一个应用
- Android 一个应用启动另外一个应用
- 注解:从一个namespace跳转到另外一个namespace,Struts2
- 从一个应用中启动另外一个应用
- ios开发之如何从一个应用跳转到另一个应用(应用间跳转)
- IOS 从一个应用跳转另一个应用
- android在一个应用中启中另外一个应用
- 10.Android在一个应用中启动另外一个应用
- Android中 一个应用启动另外一个应用一
- 变量的本质
- 2017年多校赛第一场 1011 KazaQ's Socks(找规律)
- Imagemagick常用指令
- LeetCode 作弊式刷题 7月26日
- 真实经纬度(gps)转成百度坐标的js方法
- Android 从一个应用跳转到另外一个应用
- 8种网站防止盗链的方法
- 阻止浏览器返回按钮
- Volley联网判断有无网络(1)
- Linux基础命令学习
- 使用Windbg解析dump文件
- web.xml is missing and <failOnmissingwebxml> is set to true 原因以及解决方案
- DES算法流程分析与实现
- 安卓开发没有关闭界面就调用了onActivityResult方法?onActivityResult方法Intent-data总是null