Android App跳转App以及App跳转指定App页面的实现
2016-08-26 16:52
986 查看
当前App跳转其他App
PackageManager packageManager = getPackageManager();
Intent intent = new Intent();
intent =packageManager.getLaunchIntentForPackage("com.example.abc2");
//这里面的值是你要跳转app的包名,你跳转的清单文件里的package名
//<manifest xmlns:android="http://schemas.android.com/apk/res/android"
// package="com.example.abc2"
// android:versionCode="1"
// android:versionName="1.0" >
startActivity(intent);
当前App跳转其他App指定的Activity
ComponentName comp = new ComponentName("com.example.abc2","com.example.abc2.MainActivity2");
//这里面的2个值是:
//1.你要跳转app的包名,你跳转的清单文件里的package名
//2.你要跳转app指定的Activity名
//<activity
//android:name="com.example.abc2.MainActivity2"
//android:label="@string/app_name"
//android:exported="true"你要跳转的其他App Activity这个属性一定要加
//>
//</activity>
Intent it=new Intent();
it.setComponent(comp);
this.startActivity(it);
当一个App service里跳转其他App Activity时(我是在写悬浮框里的service遇到的)
ComponentName comp = new ComponentName("com.example.windowdemo","com.example.windowdemo.MainActivity2");
Intent it = new Intent();
it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//需要加这个不然会报错
it.setComponent(comp);
startActivity(it);
PackageManager packageManager = getPackageManager();
Intent intent = new Intent();
intent =packageManager.getLaunchIntentForPackage("com.example.abc2");
//这里面的值是你要跳转app的包名,你跳转的清单文件里的package名
//<manifest xmlns:android="http://schemas.android.com/apk/res/android"
// package="com.example.abc2"
// android:versionCode="1"
// android:versionName="1.0" >
startActivity(intent);
当前App跳转其他App指定的Activity
ComponentName comp = new ComponentName("com.example.abc2","com.example.abc2.MainActivity2");
//这里面的2个值是:
//1.你要跳转app的包名,你跳转的清单文件里的package名
//2.你要跳转app指定的Activity名
//<activity
//android:name="com.example.abc2.MainActivity2"
//android:label="@string/app_name"
//android:exported="true"你要跳转的其他App Activity这个属性一定要加
//>
//</activity>
Intent it=new Intent();
it.setComponent(comp);
this.startActivity(it);
当一个App service里跳转其他App Activity时(我是在写悬浮框里的service遇到的)
ComponentName comp = new ComponentName("com.example.windowdemo","com.example.windowdemo.MainActivity2");
Intent it = new Intent();
it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//需要加这个不然会报错
it.setComponent(comp);
startActivity(it);
相关文章推荐
- Android实现深度链接(APP外带动态参数唤醒APP,并跳转指定页面,APP不论在不在运行都可以)
- JS和安卓互相调用以及Scheme协议完成外部链接跳转app指定页面
- Android客户端之“微服私访”App的系统学习(五)使用Picasso实现轮播图以及使用自定义View实现个人中心页面
- JS和安卓互相调用以及Scheme协议完成外部链接跳转app指定页面
- ios俩个APP之间跳转、传值,以及直接跳转到指定app页面 或者 app 评价页面 的方法
- iOS实现在webview页面内点击链接,跳转指定App
- JS和安卓互相调用以及Scheme协议完成外部链接跳转app指定页面
- iOS 一个app跳转另一个app并实现通信(如A跳到B并打开B中指定页面)
- Android数据库的增删改查和ListView以及页面跳转的实现
- Android实现APP欢迎页面 - 自动轮播+页面跳转+判断
- Android之项目开发中在app内Intent意图跳转自己指定的Html5页面
- Android跳转到应用商店的APP详情页面,以及 Google GMS 各个apk的包
- iOS实现在webview页面内点击链接,跳转指定App
- Android学习(二十六)APP引导页面以及小圆点滑动的实现
- Android页面跳转以及数据传递实现
- Android跳转到应用商店的APP详情页面,以及 Google GMS 各个apk的包
- 详解Android App卸载后跳转到指定的反馈页面的方法
- iOS 一个app跳转另一个app并实现通信(如A跳到B并打开B中指定页面)
- 如何实现点击一个按钮后跳转的指定的链接页面
- html setInterval() 实现指定时间跳转页面