Я создал собственный домашний экран.
Это мой код для запуска приложения при нажатии:
mainIntent = packageManager.getLaunchIntentForPackage(strPackageName);
if(mainIntent!=null)
{
mainIntent = mainIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
startActivity(mainIntent);
}
Все отлично работает, за исключением того, что при запуске Camera или Google Maps я получаю исключение:
E/AndroidRuntime(845): FATAL EXCEPTION: main
E/AndroidRuntime(845): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.camera/com.android.internal.app.ResolverActivity}; have you declared this activity in your AndroidManifest.xml?
E/AndroidRuntime(845): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1536)
E/AndroidRuntime(845): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1510)
E/AndroidRuntime(845): at android.app.Activity.startActivityForResult(Activity.java:2858)
E/AndroidRuntime(845): at android.app.Activity.startActivity(Activity.java:2964)
E/AndroidRuntime(845): at com.gears42.surelock.ApplicationLauncher.onItemClick(ApplicationLauncher.java:34)
E/AndroidRuntime(845): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/AndroidRuntime(845): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
E/AndroidRuntime(845): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime(845): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(845): at android.os.Looper.loop(Looper.java:143)
E/AndroidRuntime(845): at android.app.ActivityThread.main(ActivityThread.java:4914)
E/AndroidRuntime(845): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(845): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(845): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
E/AndroidRuntime(845): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/AndroidRuntime(845): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(872): FATAL EXCEPTION: main
E/AndroidRuntime(872): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.google.android.apps.maps/com.android.internal.app.ResolverActivity}; have you declared this activity in your AndroidManifest.xml?
E/AndroidRuntime(872): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1536)
E/AndroidRuntime(872): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1510)
E/AndroidRuntime(872): at android.app.Activity.startActivityForResult(Activity.java:2858)
E/AndroidRuntime(872): at android.app.Activity.startActivity(Activity.java:2964)
E/AndroidRuntime(872): at com.gears42.surelock.ApplicationLauncher.onItemClick(ApplicationLauncher.java:34)
E/AndroidRuntime(872): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/AndroidRuntime(872): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
E/AndroidRuntime(872): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime(872): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(872): at android.os.Looper.loop(Looper.java:143)
E/AndroidRuntime(872): at android.app.ActivityThread.main(ActivityThread.java:4914)
E/AndroidRuntime(872): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(872): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(872): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
E/AndroidRuntime(872): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/AndroidRuntime(872): at dalvik.system.NativeStart.main(Native Method)
Я использую 2.2.1 HTC Wildfire (То же самое отлично работает на Android 3.1 Samsung Galaxy Tab)
Любые предложения / обходные пути ??