调用一个活动,是在另一个包(机器人) [英] calling an activity that is in another package(android)

查看:136
本文介绍了调用一个活动,是在另一个包(机器人)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要调用一个活动,是在另一个包......

I want to call an activity that is in another package....

比方说我有一个活动(活动1)在我的(包1),我需要调用另一个活动(活性2)在另一(包2)从我的活动1。

Say for example I have an Activity(activity1) in my package(package1) and I need to call another Activity(activity2) in another package(package2) from my activity1..

我试图导入程序包2在我的包1,但它没有工作... 谁能回答我,并提供一些示例code?

I have tried to import the package2 in my package1 but it did not work... Can anyone answer me and provide some sample code?

推荐答案

看 <一href="http://stackoverflow.com/questions/3518407/android-starting-an-activity-for-a-different-third-party-app">Android:启动一个活动为不同的第三方应用

final Intent intentDeviceTest = new Intent("android.intent.action.MAIN");                
intentDeviceTest.setComponent(new ComponentName("fm.last.android","fm.last.android.LastFm"));
startActivity(intentDeviceTest);

在这里你可以改变这取决于你的情况下,意图视图。

where you can change the intent to VIEW depending on your case.

这篇关于调用一个活动,是在另一个包(机器人)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆