나는 다음과 같은 코드로 활동을 시작하려합니다 :오류 동안
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.LOCALE_CHANGED flg=0x30 } in [email protected]
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:737)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.os.Handler.handleCallback(Handler.java:605)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.os.Handler.dispatchMessage(Handler.java:92)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.os.Looper.loop(Looper.java:137)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.app.ActivityThread.main(ActivityThread.java:4368)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at java.lang.reflect.Method.invokeNative(Native Method)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at java.lang.reflect.Method.invoke(Method.java:511)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at dalvik.system.NativeStart.main(Native Method)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.launcher2/com.android.launcher2.Launcher}; have you declared this activity in your AndroidManifest.xml?
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.app.ContextImpl.startActivity(ContextImpl.java:889)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.content.ContextWrapper.startActivity(ContextWrapper.java:276)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at com.android.launcher2.LauncherModel.onReceive(LauncherModel.java:634)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
01-01 00:05:03.617: ERROR/AndroidRuntime(1458): ... 9 more
내가 시작하려고 : 나는 위의 코드에 다음과 같은 예외가
Intent i = new Intent();
i.setClassName("com.android.launcher2", "com.android.launcher2.Launcher");
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
동일한 패키지에있는 클래스의 액티비티 (com.android.launcher2
)이며이 액티비티 (Launcher
)가 매니페스트에 정의되어 있습니다. 모든
는 편집이
Intent i = new Intent(getApplicationContext(), com.android.launcher2.Launcher.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
내가 정확히 이런 짓을하고 테스트 한 확인을 보이지만
은 누군가가 나를이 오류의 원인을 알려 주시기 바랍니다 수 있습니다. 이제 활동은onNewIntent()
,
onResume()
순으로 재개됩니다. 대신
onDestroy()
및
onCreate()
시퀀스가 필요합니다. 이것을 어떻게 할 수 있습니까? 이 점에있어서 누구로부터도 도움을받을 수 있습니다.
manifest.xml에서 클래스를 선언하면 매니페스트 파일에 문제가 있다고 생각합니다. –