我正在尝试编写一个启动 Android STK Activity 的应用程序,如下所示:
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setAction(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.android.stk", "com.android.stk.StkLauncherActivity"));
startActivity(intent);
我不断收到以下错误:
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.stk/com.android.stk.StkLauncherActivity}; have you declared this activity in your AndroidManifest.xml?
我在清单中声明了以下内容:
<activity android:name="com.android.stk.StkLauncherActivity"/>