首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
Android 在一个程序中启动另一个程序
】的更多相关文章
Android 在一个程序中启动另一个程序
Android 开发有时需要在一个应用中启动另一个应用,比如Launcher加载所有的已安装的程序的列表,当点击图标时可以启动另一个应用.一般我们知道了另一个应用的包名和MainActivity的名字之后便可以直接通过如下代码来启动:Intent intent = new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_LAUNCHER); ComponentName cn = new Compon…
Android 在一个程序中启动另一个程序(包名,或者类名)
http://hi.baidu.com/xiaofanqing/item/6fd724f7c5bb6dce531c26b7 Android 开发有时需要在一个应用中启动另一个应用,比如Launcher加载所有的已安装的程序的列表,当点击图标时可以启动另一个应用.一般我们知道了另一个应用的包名和MainActivity的名字之后便可以直接通过如下代码来启动:Intent intent = new Intent(Intent.ACTION_MAIN);intent.addCategory(Inten…
IOS在一个程序中启动另一个程序
尽管iPhone不允许同时运行两个应用程序,我们可以从自己的应用程序中启动另一个应用程序,并且可以在应用程序之间共享数据.我们可以使用UIApplication类的openURL:方法从一个应用程序来启动另一个应用程序.例如,要在Safari应用程序中打开Google主页,我们可以编写如下代码: NSURL *url = [NSURL URLWithString:@ "http://google.com"]; [[UIApplication sharedApplication]o pe…
android 在一个应用中启动另一个应用
在程序开发过程当中,常遇到需要启动另一个应用程序的情况,比如在点击软件的一个按钮可以打开地图软件. 如果既有包名又有主类的名字,那就好 办了, 直接像下面就行: [html] Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); ComponentName cn = new ComponentName(packageName, cla…
Android在一个app中启动另一个App
Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); ComponentName cn = new ComponentName("com.example.timer", "com.example.timer.MainActivity");//包名,类名 intent.setComponent(cn); startActivity(in…
在android应用程序中启动其他apk程序
Android 开发有时需要在一个应用中启动另一个应用,比如Launcher加载所有的已安装的程序的列表,当点击图标时可以启动另一个应用. 一般我们知道了另一个应用的包名和MainActivity的名字之后便可以直接通过如下代码来启动: 1 Intent intent = new Intent(Intent.ACTION_MAIN); 2 intent.addCategory(Intent.CATEGORY_LAUNCHER); 3 ComponentName cn = ne…
vc++ 在程序中运行另一个程序的方法
在vc++ 程序中运行另一个程序的方法有三个: WinExec(),ShellExcute()和CreateProcess() 三个SDK函数: WinExec,ShellExecute ,CreateProcess可以实现调用其他程序的要求,其中以WinExec最为简单,ShellExecute比WinExec灵活一些,CreateProcess最为复杂. WinExec 两个参数,前一个指定路径,后一个指定显示方式. ShellExecute 可以指定工作目录,并且还可以寻找文件…
WP8的新功能-通过一个程序来启动另一个程序
Wp8对原来的WP7做了大量的优化...其中一个就包括Protocol Association,也就是通过uri来打开另外一个程序,这也就是说,我们可以做一个程序来启动另外一个程序了,如微信,QQ之类的,当然必须要有一个前提,也就是要被启动的程序必须注册一个URI关联. 我们可以通过一个实例来说明.首先给程序注册下URI关联. 选择WMAppManifest.xml点击查看代码,在Tokens后面添加Extensions属性. <Extensions> <Protocol Name=&q…
android在一个应用程序员启动另一个程序
一般我们知道了另一个应用的包名和MainActivity的名字之后便可以直接通过如下代码来启动: Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); ComponentName cn = new ComponentName(packageName, className); intent.setComponent(c…
android在程序中打开另一个程序
在开发android应用的时候,在一些情况下要有前置条件,比如这边所说的要启动时要确保别的应用程序服务已经打开 或者在操作中启动别的应用等. 先来一段google上的代码: 1. 已知包名和类名的情况下: Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); //前面两个设置是为了调用该应用的主页 也就如C#或JAVA 常说的 MAIN函数入口 Componen…