Possible to finish() my activity when Home is pressed?

by Matt Kanninen » Fri, 26 Mar 2010 08:23:07 GMT

Sponsored Links
 I think onPause is called.  It will be hard to only close your
activity in response to Home key presses, but I think you can get it
to call finish in all cases where the Home button is pressed.


Possible to finish() my activity when Home is pressed?

by And-Rider » Fri, 26 Mar 2010 14:27:46 GMT

 I am not sure about your exact requirement but if u want to launch the
parent activity each time app is launched from home add
android:clearTaskOnLaunch="true"  in your manifest to your parent
activity.This should clear the stack on launch.


Sponsored Links

Possible to finish() my activity when Home is pressed?

by Matt Kanninen » Sat, 27 Mar 2010 07:18:45 GMT

 Um, isn't an activity pause any time it's display is no longer
displayed?  Home is a special activity, but it's still an activity?
When does onPause get called then?

> >

Other Threads

1. How to make a widget that doesn't drain the battery and updates often

Please consider making that configurable and able to be disabled, as an
improvement over the brain-dead stock news-and-weather widget.

That depends on who is holding any partial WakeLocks. Generally, the CPU
shuts off shortly after the screen turns off.

Frankly, I don't know why the Genie... service sticks around for the
stock News and Weather. It does not appear to be affecting the
thoroughly irritating and non-configurable
change-the-headline-every-five-seconds feature, as that persists even
when I shut down the service via the Settings application.

Conceivably. That application is not open source at this time.

Probably not.

If you are using a WakeLock, double-check to confirm you are releasing
it properly.

Then, use this command to see if anyone else is screwing up *their*

adb shell dumpsys power

and perhaps:

adb shell dumpsys batteryinfo

to see who is messing up.

Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.5 Available!


2. Webview duplicate HTML problem

Hi all,
I load a url over the web containing images (their source is another
when then view loads the html, it loads it without the images. after
few milliseconds, the images come along but then the html is redrawn,
and it does so over the previous html, causing it the web view to hold
2 htmls one over the other (very ugly result).

anyone knows why does that happen? how can I avoid that?



3. How is it getting on ?

4. Uboot boot argument issues with SDCARD Android booting.

5. Skinning Buttons

6. Read user profile

7. How to show a dialog even if the Activity is in background