[android-developers] Re: How to force soft keyboard to be visible?

2009-10-01 Thread James W
Dwass, This is tested on the standard emulator and an unbranded Hero, running the latest official HTC ROM update, 2.73. On Dianne's suggestions, I streamlined this a bit, removing the unnecessary hide flags. To show the keyboard on the dialog's OnCreate, I use:

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-30 Thread dwass
Hello James, Thanks for the code snippet. I've actually tried this. What device did you test this on? My biggest problem is that when I find a combination that works on the G1, it doesn't work on the G2 (HTC Hero) or vice-versa. I'm expecting a nightmare when we have 12 devices out there

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-25 Thread Dianne Hackborn
Those arguments are FLAGS. Specifying 0 (none of the flags) gives you the default behavior, which for hiding is always. The flags are used to limit when it hides to certain situations. If you just want to force the keyboard to close, use hideSoftInputFromWindow(view.getWindowToken(), 0). The

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-24 Thread dwass
I don't think it is possible that this is not an interesting question, based on the amount of activity in this and other similar posts about how to hide or show the sofkeyboard programatically. I've tested a lot of this behaviour on G1 and G2 (Hero) and the behaviour is either very buggy or there

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-24 Thread Dianne Hackborn
How about no time to get into long involved discussions. On Wed, Sep 23, 2009 at 11:51 AM, Mike Collins mike.d.coll...@gmail.comwrote: Should I take the lack of reply as not an interesting question, no idea or we're checking/thinking? I would like to have some ammunition when I go up

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-24 Thread James W
Dwass, dont know if this helps, but I finally got it to work reliably for my particular needs. I have a dialog with a single edit, and I wanted to softkeyboard to automatically show when the dialog was opened, and be closed when the dialog was closed. In other words, identical behaviour to the

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-22 Thread dwass
Hi Dianne, You say that the G1 has a keyboard and so the IME is not shown by default. I don't understand that statement. Yes, the G1 has a keyboard, but it isn't always OPEN. Especially if the device is in portrait mode, the keyboard is probably NEVER open. The device should be smart enough so

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-22 Thread James W
Well, curiouser and curiouser. I made a very simple test app running under 1.5 on my Hero, with an activity showing a single EditText, after the SetContentView() call, I use the ToggleSoftInput as described above. When I run it, it does not show the keyboard. However (and I found this by

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-21 Thread James W
I have exactly the same requirement. Running on a Hero, which only has a soft keyboard. The above code is copied exactly, yet it doesnt work. The keyboard is not shown no matter where I put the code, before or after SetContentView(). This seems like a pretty standard thing to want to do, is

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-21 Thread Dianne Hackborn
All I can say is the edit contacts activity in the standard platform does this just fine, using the standard API. Either you are doing something different than it, or HTC's IME has some different behavior, but I don't know much about either of those. Do note that normally the system will not

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-21 Thread Dianne Hackborn
Oh also it doesn't show by default if the IME needs to run in fullscreen (typically because the device is in landscape). Both of these are because showing the IME is these cases is much more disruptive than showing it when the target window can resize nicely to show all of its important UI in

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-21 Thread Mike Collins
I have removed all the code around putting up or taking down or otherwise trying to influence the soft keyboard. This is running on a stock G1 with 1.5 I have two activities reachable from one main activity. All three activites have a single AutoCompleteTextView. All 3 edit boxes have

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-18 Thread Andrei Bucur
super.onCreate(savedInstanceState); InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); On Thu, Sep 17, 2009 at 11:17 PM, Mike Collins

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-18 Thread Mike Collins
That does work, thanks. Of course now I can't get it to go down when the activity finishes. Apparently because there is no equivalent of HIDE_FORCED. The only two HIDE's options don't take down a FORCED show. But without a FORCED show it doesn't show up unless the user asks for it. This seems

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-18 Thread Dianne Hackborn
Typically the emulator runs as a device that has a keyboard, in which case the system deliberately does not automatically show the IME because the user has easy access to a real keyboard. It is recommended to not defeat this behavior, resulting in an inconsistent behavior with the rest of the

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-18 Thread Mike Collins
The behavior I'm talking about is on a locked G1 with 1.5, I did not expect the emulator to be very useful. The behavior on a myTouch (locked, 1.5) is really bizarre. I'm beginning to think that I'm going to pull all the soft keyboard code out and let the user do the extra work. mike

[android-developers] Re: How to force soft keyboard to be visible?

2009-09-18 Thread Dianne Hackborn
The G1 has a keyboard, so it works as I said -- the IME is not shown by default. This is a policy decision of the platform. On a myTouch, since it doesn't have a keyboard, the IME will be shown by default in various cases (for example when you enter the edit contacts screen) when the app has