How to set AlertDialog button focus?

by blindfold » Sat, 30 Aug 2008 04:46:55 GMT


Sponsored Links
 I was looking for something like .requestFocus() to set focus for a
default button in a two-button AlertDialog, such that the user need
only press the enter key when accepting the default button (the one
that has focus). It seems though that neither PositiveButton nor
NegativeButton get a default focus, and I could not find a method to
set focus to either one of them. So how can one set focus to a
particular AlertDialog button?

Thanks.

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



How to set AlertDialog button focus?

by Chihau Chau » Sat, 30 Aug 2008 05:38:38 GMT


 Hi, maybe this url would be util for you
 http://www.maximyudin.com/2008/02/25/android/how-to-use-alertdialogbuilder-in-android-applications/ 

2008/8/29 blindfold <[EMAIL PROTECTED]>



-- 
/chihau

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


Sponsored Links


How to set AlertDialog button focus?

by blindfold » Sat, 30 Aug 2008 16:39:33 GMT


 Thanks, but here too I have to press an arrow key or something before
any of the buttons gets focus. I want one of the buttons to have focus
right away, such that just pressing OK/Enter/Fire will activate that
button without a need to click it or navigate to it.




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