How to explicitly launch the system's Home application by code?

by Kakyoin » Tue, 10 Mar 2009 20:21:05 GMT


Sponsored Links
 Topic.  Short and sweet question. And I did browse the forum before
asking.

Thank you in advance.
--~--~---------~--~----~------------~-------~--~----~



How to explicitly launch the system's Home application by code?

by Kakyoin » Tue, 10 Mar 2009 20:59:41 GMT


 




Hi. Thank you for the reply.

But actually I do have another Alternative Home application (which I
set to default for CATEGORY_HOME).

In this case, let's assume that this Alternative Home has a but in its
onCreate(), this bug cause the "Force close" screen.

The real problem is: when user set my Alternative Home as their
'default action for 'Home' ', then shutdown the device and turn it
back on. It'll keep crashing at the start up.

The user can't press back to go to system's Home app; there's no
system's Home to go back to (because my Alternative Home is the
default and is the only 'Home'  loaded at boot time)



I'm sorry for my bad English. >_<  What I'm trying to do is to handle
that bug(which actually only happen when user has no SD card present)
by doing this: "if there's no SD card inserted, then just launch the
System's Home app instead"




here's my code when the SD card is not found:

Intent i = new Intent();
i.setAction("android.intent.action.MAIN");
i.addCategory("android.intent.category.HOME");
startActivity(i); // this launch my Alternative Home (because it is
set as default)

Anyway, Thank you for your reply. =)
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to explicitly launch the system's Home application by code?

by MrSnowflake » Wed, 11 Mar 2009 02:40:23 GMT


 As I said on Anddev.org earlier:
Intent myIntent = new Intent();
myIntent.setClassName("com.android.launcher",
"com.android.launcher.Launcher");
startActivity(myIntent);






--~--~---------~--~----~------------~-------~--~----~



How to explicitly launch the system's Home application by code?

by MrSnowflake » Wed, 11 Mar 2009 02:41:35 GMT


 I have to say, I don't think this method will keep working in future
versions as the package and class name of the launcher might change!







--~--~---------~--~----~------------~-------~--~----~



How to explicitly launch the system's Home application by code?

by Kakyoin » Wed, 11 Mar 2009 13:53:48 GMT


 Hi. Thank you all for the answers.

Launching by class name was very helpful for now but following your
advice, I'll not use that method. >_<


--~--~---------~--~----~------------~-------~--~----~



How to explicitly launch the system's Home application by code?

by MrSnowflake » Wed, 11 Mar 2009 21:26:49 GMT


 ut using CATEGORY_HOME won't solve his problem.

On 10 mrt, 19:41, Romain Guy <romain...@google.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



How to explicitly launch the system's Home application by code?

by MrSnowflake » Thu, 12 Mar 2009 05:22:14 GMT


 ice, thanks!

On 11 mrt, 19:14, Dianne Hackborn <hack...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Anyone been asked by dev to change their rating for their app on market?

I won't give details of the app or dev, but I thought it was a bit
cheeky!

If my review or rating was based on a factual error then fair enough,
but in this case it was just a dev saying in not so many words that I
should up the rating I gave.
--~--~---------~--~----~------------~-------~--~----~

2. SurfaceFlinger and permitions

I'm porting my app on the t-mobile G1. this app uses OpenGL (using the
glSurfaceView from API demo )

my app works fine on the emulator with these minor errors :

04-24 16:57:04.957: ERROR/GLLogger(213): couldn't load <libhgl.so>
library (Cannot find library)
04-24 16:57:05.147: DEBUG/SurfaceFlinger(45): pid 213 requesting gpu
surface (current owner = -1)
04-24 16:57:05.157: ERROR/MemoryHeapBase(45): error opening /dev/
pmem_gpu1: No such file or directory
04-24 16:57:05.157: ERROR/MemoryHeapBase(45): error opening /dev/
pmem_gpu0: No such file or directory
04-24 16:57:05.157: DEBUG/SurfaceFlinger(45): pid 213 requesting gpu
surface (current owner = -2)
04-24 16:57:05.157: ERROR/MemoryHeapBase(45): error opening /dev/
pmem_gpu1: No such file or directory
04-24 16:57:05.157: ERROR/MemoryHeapBase(45): error opening /dev/
pmem_gpu0: No such file or directory


when lauching it on the G1 errors become :
and the app simply close.

D/SurfaceFlinger(18083): pid 18620 requesting gpu core (owner = -1)
D/SurfaceFlinger(18083): pid 18620 requesting gpu surface (current
owner = -1)
D/SurfaceFlinger(18083): gpu surface granted to pid 18620
D/SurfaceFlinger(18083): pid 18620 requesting gpu surface (current
owner = 18620)
D/SurfaceFlinger(18083): gpu surface granted to pid 18620
I/ActivityManager(18083): Displayed activity
com.aquafadas.glLibrary/.TestLib: 11906 ms
D/EGL.oem (18620): SMI  region at virtual=0x45648000, physical=0x0,
size=7340032 offset=0
D/EGL.oem (18620): EBI1 region at virtual=0x45d48000,
physical=0x16500000, size=8388608 offset=1228800
D/EGL.oem (18620): REGS region at virtual=0x44c44000,
physical=0xa0000000, size=1048576, offset=0
D/dalvikvm(18620): GC freed 1754 objects / 95936 bytes in 108ms
D/dalvikvm(18620): GC freed 309 objects / 15832 bytes in 92ms
D/dalvikvm(18620): GC freed 63 objects / 2152 bytes in 93ms
D/dalvikvm(18620): GC freed 70 objects / 2592 bytes in 91ms
I/ActivityManager(18083): Process com.navigaia.android (pid 18319) has
died.
D/dalvikvm(18620): GC freed 44 objects / 1576 bytes in 118ms
D/dalvikvm(18620): GC freed 52 objects / 1856 bytes in 93ms
D/dalvikvm(18620): GC freed 50 objects / 1784 bytes in 92ms
D/dalvikvm(18620): GC freed 52 objects / 1840 bytes in 91ms
D/dalvikvm(18620): GC freed 50 objects / 1784 bytes in 94ms
D/dalvikvm(18620): GC freed 44 objects / 1560 bytes in 95ms
D/dalvikvm(18620): GC freed 52 objects / 1840 bytes in 120ms
D/dalvikvm(18620): GC freed 50 objects / 1784 bytes in 92ms
D/dalvikvm(18620): GC freed 44 objects / 1568 bytes in 91ms
D/dalvikvm(18620): GC freed 44 objects / 1576 bytes in 92ms
D/dalvikvm(18620): GC freed 52 objects / 2576 bytes in 93ms
I/ActivityManager(18083): Process
com.smartcapsules.cooking.android.taster (pid 18288) has died.
I/DEBUG   (   29): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   (   29): Build fingerprint: 'android-devphone1/
dream_devphone/dream/trout:1.1/UNLOCKED/142608:userdebug/test-keys'
I/DEBUG   (   29): pid: 18620, tid: 18636  >>> com.aquafadas.glLibrary
<<<
I/DEBUG   (   29): signal 11 (SIGSEGV), fault addr 000000c0
I/DEBUG   (   29):  r0 00000018  r1 001a94d8  r2 00000001  r3 00000000
I/DEBUG   (   29):  r4 001aa4d8  r5 001a94d8  r6 ad31a3fc  r7 00000000
I/DEBUG   (   29):  r8 fffffffe  r9 ffffffff  10 00000001  fp deadbeef
I/DEBUG   (   29):  ip 00000000  sp 44c43d78  lr 8012eaac  pc
80123250  cpsr 00000010
I/DEBUG   (   29):          #00  pc 80123250  /system/lib/libhgl.so
I/DEBUG   (   29):          #01  lr 8012eaac  /system/lib/libhgl.so
I/DEBUG   (   29): stack:
I/DEBUG   (   29):     44c43d38  00000320
I/DEBUG   (   29):     44c43d3c  afe35d78
I/DEBUG   (   29):     44c43d40  001e62d0  [heap]
I/DEBUG   (   29):     44c43d44  001aac70  [heap]
I/DEBUG   (   29):     44c43d48  ffffffcf
I/DEBUG   (   29):     44c43d4c  00000000
I/DEBUG   (   29):     44c43d50  ffffffe0
I/DEBUG   (   29):     44c43d54  8012eaac  /system/lib/libhgl.so
I/DEBUG   (   29):     44c43d58  001aac70  [heap]
I/DEBUG   (   29):     44c43d5c  8012ea00  /system/lib/libhgl.so
I/DEBUG   (   29):     44c43d60  001aa4d8  [heap]
I/DEBUG   (   29):     44c43d64  001a94d8  [heap]
I/DEBUG   (   29):     44c43d68  ad31a3fc  /system/lib/
libandroid_runtime.so
I/DEBUG   (   29):     44c43d6c  00000000
I/DEBUG   (   29):     44c43d70  df002777
I/DEBUG   (   29):     44c43d74  e3a070ad
I/DEBUG   (   29): #00 44c43d78  44c43dc0
I/DEBUG   (   29):     44c43d7c  00000000
I/DEBUG   (   29):     44c43d80  ad31a3fc  /system/lib/
libandroid_runtime.so
I/DEBUG   (   29):     44c43d84  41016eb4
I/DEBUG   (   29):     44c43d88  44c43da0
I/DEBUG   (   29):     44c43d8c  41016eac
I/DEBUG   (   29):     44c43d90  41016e98
I/DEBUG   (   29):     44c43d94  00000001
I/DEBUG   (   29):     44c43d98  acb15524
I/DEBUG   (   29):     44c43d9c  ad00d9f8  /system/lib/libdvm.so
I/DEBUG   (   29):     44c43da0  41092718
I/DEBUG   (   29):     44c43da4  001e0ee8  [heap]
I/DEBUG   (   29):     44c43da8  ad31a3fc  /system/lib/
libandroid_runtime.so
I/DEBUG   (   29):     44c43dac  00000000
I/DEBUG   (   29):     44c43db0  00003072
I/DEBUG   (   29):     44c43db4  001e0ee8  [heap]
I/DEBUG   (   29):     44c43db8  44c43dc0
I/DEBUG   (   29):     44c43dbc  ad041211  /system/lib/libdvm.so
I/ActivityManager(18083): Process com.aquafadas.glLibrary (pid 18620)
has died.
D/Zygote  (18059): Process 18620 terminated by signal (11)
E/SurfaceFlinger(18083): HW3D_REVOKE_GPU failed (Operation not
permitted), mFD=100, base=0x4b670000
I/WindowManager(18083): WIN DEATH: Window{4363a5f0 SurfaceView}
I/WindowManager(18083): WIN DEATH: Window{43611138
com.aquafadas.glLibrary/com.aquafadas.glLibrary.TestLib}


the error is :
E/SurfaceFlinger(18083): HW3D_REVOKE_GPU failed (Operation not
permitted), mFD=100, base=0x4b670000

what should I do to avoid this to happen?
thx for helping.
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. How to create two TextView without write the XML file?

4. UK Sales of the G1

5. Android 1.5: Problems developing on a device

6. what is the maximum size of an app?

7. AnimationDrawable class recompile error