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 AlertDialog.show() 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
right.
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.
Rob






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


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 <rob.fr...@gmail.com> wrote:


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



Other Threads

1. 1.6: Quick search box to pass parameters to an application

Hey,

I was wondering if it were possible to use the quick search box to
pass parameters to an application?
E.g. If I had a timesheet application called HagridIsHugeAndAnnoying,
I'd want to be able to enter: "hihaa 7hrs sleeping" in the quick
search box and an action of "Create time entry ..." would show up in
the results. This would launch an intent and either just say "Yay
done" or if it needs user intervention show a dialog / screen.

So I guess I'd want to be able to say search "hihaa <anything>" should
call Intent X and Intent X should be able to parse the query.

Thanks,
Danny.
--~--~---------~--~----~------------~-------~--~----~

2. LinearLayout, specify children width in percentages?

Hi,

Is it possible to create a horizontal LinearLayout where we specify
how wide percentage-wise each element is? Something like:

 LinearLayout ll = new LinearLayout();
 ll.add(new TextView("a"));
 ll.setViewWidthAtIndex(0, 30);
 ll.add(new TextView("b"));
 ll.setViewWidthAtIIndex(1, 50);
 ll.add(new TextView("c"));
 ll.setViewWidthAtIndex(2, 20);

Thanks
--~--~---------~--~----~------------~-------~--~----~

3. USB Host/Serial Port access

4. LinearLayout, specify children width in percentages?

5. How to Use ISurface

6. Socket client does not work with emulator

7. USB On-The-Go