您的位置:首页 > 其它

如何在一个程序里面呼叫另一个程序

2008-11-01 14:58 351 查看
方法1
String cmd_execute = "am start -n package名称/package名称.程序名";
try {
Process child = Runtime.getRuntime().exec(cmd_execute);
Log.i("info", "execute command");
} catch (IOException e) {
e.printStackTrace();
}

方法2
用intent。。。。。。
在主类中比如按钮里添加
Intent intent = new Intent();
intent.setAction("custom.intent.action.RSS");
startActivity(intent);
再在要跳转到的工程manifest中要跳到的activity里加
<intent-filter>
<action android:name="custom.intent.action.RSS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
就可以 了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐