Android的明确意图与目标组件意图、组件、明确、目标

由网友(奋不顾身)分享简介:是否有可能解雇明确的意图,但没有从我的项目,但对于活动在其他一些应用的活动。Is it possible to fire explicit intent but not for an activity from my project but for activity in some other application...

是否有可能解雇明确的意图,但没有从我的项目,但对于活动在其他一些应用的活动。

Is it possible to fire explicit intent but not for an activity from my project but for activity in some other application.

我相信这code,我知道它正在运行

I am sure of this code and I know it is running

Intent i=new Intent(this,MyActivity.class);

但是否有可能做这样的事情

But is it possible to do something like this

Intent i=new Intent(this,com.bzz.bla.bla.SomeActivity.class);

我的意思是从其他应用程序显式开始活动的(即包含在其他的apk活性)的确切方式, 这是可能的吗?

I mean what is the exact way of explicitly starting activity from other application (activity that is contained in other apk), is this possible at all ?

我试过,但它滴我forse关闭消息...:(

I tried but it drops me forse close message... :(

推荐答案

是的,它是可能的。但是,创造一个Intent是不同的。试试这个:

Yes it's possible. But creation of an Intent is different. Try this:

Intent intent = new Intent();
intent.setComponent(new ComponentName("packagename whos activity u want to launch","classname.java"));
startActivityForResult(intent);
阅读全文

相关推荐

最新文章