调用方代码:
<span style="white-space:pre"> </span> Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName("com.android.factorytest", "com.android.factorytest.ChangeLogoAnimation");
try {
context.startActivity(intent);
} catch (ActivityNotFoundException e) {
Log.i(TAG, "===ActivityNotFoundException===");
return false;
}
return true;
被调用方注册:
<span style="white-space:pre"> </span> <activity
android:name=".ChangeLogoAnimation"
android:label="@string/change_logoAnimation"
android:screenOrientation="portrait"
android:exported="true"/>
<span style="white-space:pre"> </span>注意最后设置的输出很重要,不然不但访问不了,也许还会出现没有权限运行错误。
但是好像如果Activity是被调用应用的主活动的话,即写了:
<span style="white-space:pre"> </span> <intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<span style="white-space:pre"> </span>这个时候不需要再设置输出都可以访问。