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.




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



Other Threads

1. NO API to find out Widget is in Foreground or Background. Any other Alternative API's to achieve this Functionality

NO API to find out Widget is Foreground or Background. Any other
Alternative API's to achieve this Functionality.
Can Anybody Help how to find out Widget is in Foreground or
Background.

I am trying so hard to find out Widget is visible or Hide in Home
screen. I am not using Android Default Home screen. We are using
Custom Home Screen.

-- 

2. how to mute radio and route audio via bluetooth connection

Hi All,

While driving, if I receive an incoming call the car radio is
automatically muted and the incoming call is routed through to my car
radio.  All other applications require me to switch the radio mode to
"Bluetooth Audio".

I'm curious if there is a way to simulate the default incoming call
functionality.  Specifically, I'd like to be able to have my
application interrupt, mute the radio, route it's audio through, then
when complete unmute the radio (the same as an incoming call does when
your car is setup with a mute wire).   The app works as expected other
than I can't hear any output unless the car is set to "bluetooth
audio" manually.

I haven't found much on the subject in my searches around the topic.
So far I've played with variations of following and had no luck:

AudioManager audioMan = (AudioManager)
getSystemService(Context.AUDIO_SERVICE);
audioMan.setStreamSolo(AudioManager.STREAM_VOICE_CALL, true);
audioMan.setBluetoothScoOn(true);
audioMan.setMode(AudioManager.MODE_IN_CALL);
ttsEngine.speak("Hello World", TextToSpeech.QUEUE_FLUSH, null);
audioMan.setStreamSolo(AudioManager.STREAM_VOICE_CALL, false);
audioMan.setMode(AudioManager.MODE_NORMAL);
audioMan.setBluetoothScoOn(false);

I've also included the following in the manifest file:

<uses-permission
android:name="android.permission.MODIFY_AUDIO_SETTINGS"></uses-
permission>

Honestly, I'm not even sure if I'm even close to being on the right
track since all my attempts have resulted in code that doesn't break
anything but gets me no closer to the goal.

Any assistance here would be much appreciated.

thanks,
steve

-- 

3. POSDroid

4. All Audio output to streaming

5. Make sure the surfaceView or associated SurfaceHolder has a valid Surface

6. using iText with Android

7. Display bug with buttons (and others)