Can't get the softinput to show up programmatically

by jade » Tue, 02 Jun 2009 23:53:56 GMT

Sponsored Links
 We have a dialog box that includes an EditText field. We'd like the
softkeyboard to already appear in the dialog when the dialog opens
instead of the user first having to touch the EditText field. I've
read other posts and tried to incorporate the suggestions but there's
something that I'm missing.

Here's my code from onStart (you'll notice that I'm calling several
similar methods because from the documentation it's not clear :

  protected void onStart() {
      editText.setFocusable(true);    // which of these should I call?
      editText.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,
      InputMethodManager imm = (InputMethodManager)
      imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);

      //android.R.attr.windowSoftInputMode | stateAlwaysVisible); // #windowSoftInputMode

It seems like I might be able to use this type of  code
programatically (due to our project constraints, we build this dialog
programatically instead of via an xml file):   //
android.R.attr.windowSoftInputMode  stateAlwaysVisible); // #windowSoftInputMode

Any pointers would be appreciated!



Can't get the softinput to show up programmatically

by Bhargavi » Wed, 10 Jun 2009 16:33:46 GMT

 Hi Jade,

  did u get a clue on this as iam also stuck with a similar
problem..please reply back if this issue is resolved. I too need the
softkeyboard to get displayed without touching the edit box in my
dialog .



Sponsored Links

Other Threads

1. About Theme and style method

Dear all:

Android provide us some themes like:

We can use "setTheme(xxxxxx)" to set our theme.

My question is :

Can I replace our android theme in run time?

2. Kernel Android

Hi everybody

I have a question Anyone knows what happen when do you compile and pass the 
image to the phone?

when I passed the image to the phone I didn't see something different, I am 
trying to run Android in a n800.

  Version: 22.10.89
  GE/M/CS s+:+ a--- C+++ UL++ P L+ E--- W+ N* o+++ K- 
  w O-- M- V++ PS Y PGP--- t-- 5 X++++ R-- tv+ b DI- 
  D G+++ e++ h--/! r- z--
Explore the seven wonders of the world

3. The Android Ringtone...

4. glGetFloatv throws an UnsupportedOperationException

5. Wifi and all the stuff i want

6. Network Connection while the phone is ringing

7. Is Anyone else using App Engine as part of their Android App?