http://androidappdocs.appspot.com/reference/android/content/Intent.html#setComponent(android.content.ComponentName)
Intent Resolution
There are two primary forms of intents you will use.
-
Explicit Intents have specified a component (via
setComponent(ComponentName)
orsetClass(Context, Class)
), which provides the exact class to be run. Often these will not include any other information, simply being a way for an application to launch various internal activities it has as the user interacts with the application.显式调用,如果知道明确的模块名称,可以直接用Itent类的setComponent和setClass方法来配置intent,并用startActivity来启动应用;
比如:
apk中有一个名为 HelloAndroid的Activity, 包路径为com.android.test.HelloAndroid.
调用如下:
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.test", "com.android.test.HelloAndroid"));
startActivity(intent); -
Implicit Intents have not specified a component; instead, they must include enough information for the system to determine which of the available components is best to run for that intent.
隐式的调用是指让系统给你返回可以打开这个文件的应用程序列表,然后从列表中选取确切的程序来运行。(这个下次再看看,这里没弄)