Why different behaviour when exiting app using BACK and HOME ?

by Jean-Baptiste Queru » Thu, 05 Mar 2009 21:58:02 GMT


Sponsored Links
 The default behavior of the back key is to exit your activity by
calling finish() (which should pop to the next activity in the
activity stack of the task your activity was in, or to another task if
your activity was at the bottom of its task). You can override that.

The behavior of the home key is to switch to the home application, but
your activity doesn't exit.

JBQ






-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

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



Why different behaviour when exiting app using BACK and HOME ?

by Jean-Baptiste Queru » Fri, 06 Mar 2009 05:10:04 GMT


 You can capture the back key and make it do whatever you want.

JBQ








-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

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


Sponsored Links


Why different behaviour when exiting app using BACK and HOME ?

by Marco Nelissen » Fri, 06 Mar 2009 06:22:27 GMT


 ctivity.onKeyDown()


On Thu, Mar 5, 2009 at 2:11 PM, TAKEphONE <shimo...@gmail.com> wrote:

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



Why different behaviour when exiting app using BACK and HOME ?

by Dianne Hackborn » Fri, 06 Mar 2009 07:02:22 GMT


 ut, you know, changing your app to be inconsistent with the standard app
model used by the system is generally not a good idea.

Every app I download that doesn't let me press back to get out of it has a
special little black spot in my heart.

On Thu, Mar 5, 2009 at 2:55 PM, TAKEphONE <shimo...@gmail.com> wrote:



--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support. All such questions should be posted on public
forums, where I and others can see and answer them.

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



Why different behaviour when exiting app using BACK and HOME ?

by Dianne Hackborn » Fri, 06 Mar 2009 07:42:47 GMT


 




To be fair, the browser is basically emulating an activity stack within a
single activity, so it makes sense for it to steal the back key in certain
situations to do that behavior.

But sometimes it does the wrong thing, and is very annoying.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

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



Other Threads

1. setText for EditText is not working in 1.5

> There is no problem with addTextChangedListener. As long as I

What does your stack trace tell you?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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

2. AndCooper Build Tool Release

I should be releasing a 0.1 version of the AndCooper ANT based Build
tool tonight or on Tuesday.

Features:

-can set as incremental builder with most modern IDEs
-auto runs code testing as part of compile target
-support for webview by testing js using jlint and js javadocs
generation
-auto copies build file to tests dir has right targets for emma
testing and etc
-folders for your profiling data dumps and the heap dump files

Long term plans:
-merge test reports together for web dash board(probably light Jetty
and Groovy/Grails combo)
-Birt adapters to import test results to Birt for easy analysis.

I want to thank Google engineers, OHA members, and Android developers
for putting up with my questions.

The link to the project pages can be found at the MobileBytes blog
under the FOSS page:

http://mobilebytes.wordpess.com

And yes  this tool adjusts to future versions up to 3.0 right now as
long as they do not change that setup. I have some mistakes to clear
up today and some re-organizing but anyone is welcome to look at the
code.

Hopefully I have balance the needs of those Application developers
outside of the OEMs and as well those OEMs building applications for
inclusion in their devices.

As far as running multiple emulators with the script, I have moved
back to doing it the original Google way of assuming that the emulator
is running and at a later date change it to feature that aspect.

Peace and Happy Hacking
--~--~---------~--~----~------------~-------~--~----~

3. Internal JVM memory questions

4. How to detect idle screen?

5. How to programmatic obtain current app path?

6. PreferenceActivity, using the built-ins with style

7. how to run android source code in linux eclipse??