启动其他APP的Activity
来源:互联网 发布:淘宝专业版能放视频吗 编辑:程序博客网 时间:2024/05/17 22:17
// 这个是另外一个应用程序的包名, 这个参数是要启动的ActivityComponentName componetName = new ComponentName("com.example.testtask", "com.example.testtask.Main2Activity");try {Intent intent = new Intent();intent.setComponent(componetName);startActivity(intent);} catch (Exception e) {Toast.makeText(getApplicationContext(), "可以在这里提示用户没有找到应用程序,或者是做其他的操作!", 0).show();}以上代码只能在启动某个应用的主Activity或带有
<intent-filter> <category android:name="android.intent.category.DEFAULT" /></intent-filter>的Activity
方法二:
在别调用的activity中加入
<intent-filter> <action android:name="chroya.foo"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter>启动activity
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY,"searchString") startActivity(intent);
1 1
- 启动其他APP的Activity
- 启动其他APP的Activity
- 允许其他APP启动您的Activity
- 通过Intent启动其他APP的Activity
- 启动其他app中的activity
- 和其他App交互(3)允许其他App启动我们的Activity
- Activity通信 之 允许其他的APP启动你的Activity
- activity隐式启动和启动其他app
- Training--与其他APP通信(3)-- 允许其他应用启动你的Activity
- Android啓動其他app的Activity
- 【Android】如何启动调用其他app中的Activity
- Android---其他程序启动自己的Activity
- 启动其他的Activity并返回结果
- 启动其他APK的Activity方法
- 启动其他APK的Activity方法
- Android之启动其他的activity
- 允许其他应用程序启动你的Activity
- 允许其他应用启动您的 Activity
- Leach协议nam过程实现
- NSDate 年 月 日 星期 毫秒数
- Why I open the blog ?
- 微端下载用到的代码
- control_management_pack_access
- 启动其他APP的Activity
- AT91SAM9260下GPIO的使用
- android:descendantFocusability用法简析
- Comparable&Comparator
- c
- TI DAVINCI开发原理(总共5部分)
- 微端开发的 几点经验
- arm交叉编译器编译boost库并调用(记录)
- Centos系统备份与恢复教程