android中使用代码启动其他程序
来源:互联网 发布:淘宝女鞋店铺名字 编辑:程序博客网 时间:2024/05/18 00:01
你要訪問其他的程序,那麼這個程序要先裝載到模擬器或真機上面,因為我們要使用要訪問其他程序的包。
簡單的訪問有以下兩種方式(目前只知道這兩種):
一、使用Intent的setComponent方法
二、使用包管理器
一、使用Intent的setComponent方法
Intent intent = new Intent();
intent.setComponent(new ComponentName("包名", "包名.主類名"));
intent.setAction(Intent.ACTION_VIEW);
startActivity(intent);
二、使用包管理器
Intent intent = new Intent();
intent = getPackageManager().getLaunchIntentForPackage("包名");
startActivity(intent);
簡單的訪問有以下兩種方式(目前只知道這兩種):
一、使用Intent的setComponent方法
二、使用包管理器
一、使用Intent的setComponent方法
Intent intent = new Intent();
intent.setComponent(new ComponentName("包名", "包名.主類名"));
intent.setAction(Intent.ACTION_VIEW);
startActivity(intent);
二、使用包管理器
Intent intent = new Intent();
intent = getPackageManager().getLaunchIntentForPackage("包名");
startActivity(intent);
0 0
- android中使用代码启动其他程序
- 使用代码启动其他程序
- UNITY3D android 启动其他程序,启动apk C#代码
- UNITY3D android 启动其他程序,启动apk C#代码
- android应用程序中启动或卸载其他apk程序
- Android 隐藏程序的图标并使用其他APP启动
- C#启动其他程序的代码
- Qt 5.7 android 启动其他Android程序
- [Android]检测和启动其他程序
- Android---其他程序启动自己的Activity
- android 程序外启动其他应用
- iOS在程序中启动其他应用
- 如何在android应用程序中启动其他apk程序,被启动程序退出后返回之前的程序
- 如何在android应用程序中启动其他apk程序,被启动程序退出后返回之前的程序?
- android启动其他应用的一段代码
- android 启动其他应用的一段代码
- android启动其他应用的一段代码
- android启动其他应用的一段代码
- Android TextView中显示彩虹字
- Android getWidth和getMeasuredWidth的正解
- ThinkPHP 自定义函数
- listView背景问题以及限制editText字数以及如果想通知别人已经不能在写
- android上一些方法的区别和用法的注意事项
- android中使用代码启动其他程序
- Java内部类详解
- 策略模式(Strategy Pattern)
- 模拟银行ATM机
- android开发之gallery 实现滚动一张且短距离滑动实现滚动
- Android自定义组合控件
- Android预定义样式
- 进阶:在ListView中实现顶部和底部的箭头
- 自定义ViewGroup 实现拖动跟快速滚动的效果