Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

by Marco Nelissen » Fri, 29 May 2009 12:45:34 GMT

Sponsored Links
 It's not a bug. I'm guessing you were expecting to block
until the user makes the choice, but that's not how it works.
It's easy to make this work though: simply don't call super.onKeyDown() when
the user pressed the back button. That will keep the system from ending your
activity. Then just call finish() when you do want to end the activity.


Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

by Rob Franz » Fri, 29 May 2009 12:50:35 GMT

 Thanks Marco.  Took out the super.onKeyDown and it does block... you're
However, my complaint on the other thing - lack of setPositiveButton and
setNegativeButton - still stands :-)

If I do two calls to setButton, I only get the last button.  Were the above
two functions removed?

Thanks again.


Sponsored Links

Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

by Rob Franz » Fri, 29 May 2009 20:23:38 GMT

 YI, looks like setPositiveButton and setNegativeButton are gone, and now
you have setButton, setButton2, and setButton3.
On Fri, May 29, 2009 at 12:50 AM, Rob Franz <> wrote:


Other Threads

1. java.lang.ArrayIndexOutOfBoundsException: too much data for RSA block

I am using Asymmetric Cipher RSA algorithm for encryption and
decryption. I am generating private and public keys and using them for
encryption and decryption respectively. Following is the code snippet.

 KeyPair keypair =

 private  Cipher cipher = = Cipher.getInstance("RSA");

public String encrypt(String plaintext) throws Exception{
        byte[] bytes = plaintext.getBytes("UTF-8");

        byte[] encrypted =  cipher.doFinal(bytes);

        return new String(encrypted);

    public String decrypt(String encrypted) throws Exception{
        byte[] bts = encrypted.getBytes("UTF-8");

        byte[] decrypted = cipher.doFinal(bts);

        return new String(decrypted,"UTF-8");

Encryption is working fine. But while decryption it is throwing the
error "java.lang.ArrayIndexOutOfBoundsException: too much data for RSA
block". Please let me know how to resolve this problem. Please suggest
me if any other asymmetric algorithms to work on large data.

Thank you,


2. Emulator is crashing a lot


I am trying to test my app on android emulator. So as soon as, i am
choosing run the application, a new window pops up on the screen and
after taking 1-2 minutes, it goes not responding.

I also tried running the emulator separately using AVD manager. Using
this, i am able to start the emulator; but after 3-4 minutes - it goes
"not responding".

OS- Windows 7 32 bit [ intel pentium 3.00 GHZ + 2GB RAM]

Java - 1.6

Android SDK - i have the latest SDK with 3.0 OS

IDE - eclipse Helios Service Release 2.

Plz help, i am unable to do anything.


3. Porting to a new product (preffered directory structure)

4. kernel debug capability for ADB

5. how to get bytes for mp3 song that is playing by mediaplayer?

6. Android License response 鈥淩espond normally鈥

7. Blend buttons over the video layer