Android的明确意图与目标组件 [英] Android explicit intent with target component

查看:81
本文介绍了Android的明确意图与目标组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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);

这篇关于Android的明确意图与目标组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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