Can't start from Android 4.0
I want to launch the home screen. From my app I used to do this
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
I am also following this thread Now I am having a problem launching in ICS (4.0). The problem is that I cannot start the home screen while I am logged into some other application (to test this, I created a thread in my application that will sleep for 5 seconds and trigger an intent so that I have time. to go to another application) it works fine in version 2.2 but with error 4.0
Is it because of the new architecture and way of handling actions in 4.0?
Logs for 2.2 log
03-13 14:33:18.661: I/ActivityManager(73): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.examples.notifications/.NotificationsActivity }
03-13 14:33:19.161: I/ActivityManager(73): Displayed activity com.examples.notifications/.NotificationsActivity: 349 ms (total 349 ms)
03-13 13:39:23.601: I/ActivityManager(73): Starting activity: Intent { cmp=com.examples.notifications/.TransparentActivity }
03-13 13:39:23.981: I/ActivityManager(73): Displayed activity com.examples.notifications/.TransparentActivity: 368 ms (total 368 ms)
03-13 13:39:29.141: D/dalvikvm(150): GC_EXPLICIT freed 1355 objects / 84488 bytes in 116ms
03-13 13:39:30.834: D/home(317): navigating to home
03-13 13:39:30.851: I/ActivityManager(73): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher }
03-13 13:39:30.941: W/InputManagerService(73): Ignoring hideSoftInput of: com.android.internal.view.IInputMethodClient$Stub$Proxy@451106e0
03-13 13:39:36.612: D/dalvikvm(317): GC_EXPLICIT freed 1704 objects / 109584 bytes in 108ms
For 4.0 ICS
03-13 13:43:02.343: I/ActivityManager(78): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.examples.notifications/.NotificationsActivity} from pid 188
03-13 13:43:02.343: W/WindowManager(78): Failure taking screenshot for (120x180) to layer 21010
03-13 13:43:02.393: W/NetworkManagementSocketTagger(78): setKernelCountSet(10040, 1) failed with errno -2
03-13 13:43:03.333: I/ActivityManager(78): Displayed com.examples.notifications/.NotificationsActivity: +946ms
03-13 13:43:03.602: W/InputManagerService(78): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@411d4098 (uid=10009 pid=188)
03-13 14:13:21.872: I/ActivityManager(78): START {cmp=com.examples.notifications/.TransparentActivity} from pid 557
03-13 14:13:21.872: W/WindowManager(78): Failure taking screenshot for (120x180) to layer 21015
03-13 14:13:22.012: V/PhoneStatusBar(143): setLightsOn(true)
03-13 14:13:22.502: D/dalvikvm(78): GC_CONCURRENT freed 499K, 11% free 8764K/9799K, paused 5ms+10ms
03-13 14:13:22.545: W/ThrottleService(78): unable to find stats for iface rmnet0
03-13 14:13:22.692: I/ActivityManager(78): Displayed com.examples.notifications/.TransparentActivity: +703ms
03-13 14:13:24.802: D/dalvikvm(143): GC_CONCURRENT freed 420K, 19% free 7121K/8775K, paused 15ms+7ms
03-13 14:13:25.812: W/WindowManager(78): Failure taking screenshot for (120x180) to layer 21025
03-13 14:13:26.192: V/PhoneStatusBar(143): setLightsOn(true)
03-13 14:13:26.361: W/ActivityManager(78): Activity pause timeout for ActivityRecord{4124ffb0 com.examples.notifications/.TransparentActivity}
03-13 14:13:26.373: W/NetworkManagementSocketTagger(78): setKernelCountSet(1000, 1) failed with errno -2
03-13 14:13:28.825: D/home(557): navigating to home
03-13 14:13:28.833: I/ActivityManager(78): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x400000 cmp=com.android.launcher/com.android.launcher2.Launcher} from pid 557
03-13 14:13:28.864: W/NetworkManagementSocketTagger(78): setKernelCountSet(10040, 0) failed with errno -2
+3
source to share
No one has answered this question yet
See similar questions:
or similar: