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. Problem with Crypto APIs between Android and SUN Java

Hi,

I am writing an application that uses Digest MD5 to authenticate a
client (android phone) to a server (running on SUN Java 1.6.0_02). The
authentication, which works fine, if I run the client from a normal
computer (not the Dev phone), does not succeed when the client is
running on the phone.

I started digging deep into the client and server authentication code
and I figured out that the following code yields different results,
when executed on the Dev Phone and on the SUN JVM:

1  Mac hmac = Mac.getInstance("HmacSHA256");
2  SecretKeyFactory kf = SecretKeyFactory.getInstance("DES");
3  Key k = kf.generateSecret(ks);
4  hmac.init(k);
5  finalKey = hmac.doFinal(s);

The fact is that the key 'k' contains different byte values (De{*filter*}--
The reason is, that on the phone, the SecretKeyFactory kf which
generate k in line 3 returns a different results.
On the phone the implementation of the factory kf, which is returned
in line 2 is provided by the Bouncy Castle Provider. On the SUN JVM it
is the SUN implementation.
Obviously, both implementations - though using the same algorithm
(DES) - calculate different results.

Did anyone experience this before? Is that a known issue that might be
solved by a newer Java version?
Maybe it is a bug.

Oh one more thing: when you compare the values of the byte-array of
the Key k, which was generated by the SUN provider and the Bouncy
Castle one, you can see that the values are almost identical. They
only deviate by +1, 0, and -1 in an unregular pattern.

E.g. if
     k_phone = 54, 51, 54, 57, 54, 53, 53, 52
then
     k_sun    = 55, 50, 55, 56, 55, 52, 52, 52

so that is:      +1, -1, +1, -1, +1,  -1,  -1,   0

I wonder whether this has anything to do with parity bits or
something. I am not a crypto guy.

Any help is greatly appreciated.

Thanks.
--~--~---------~--~----~------------~-------~--~----~

2. How to set WebView zoom manually?

How to set 1x zoom manually in WebView?

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

3. Where is the SIM Application Toolkit (STK) menu?

4. How to recover stopped activities

5. ListView including a TextView and Checkbox - Both need to handle clicks!

6. How to hang an outgoing call? (Revisited, Partly solved here)

7. Accelerometer data