How to prevent the soft keyboard from ever appearing in my Activity?

I've never once seen that happen and I just tried it and it doesn't work on my phone Also, that sounds like a user problem. Don't try to subvert the user. If the user REALLY wants to open a keyboard in your app, you should let them and if it's useless, they'll hit back and it will go away A more concerning issue should be that your buttons are so close to the menu buttons.

But if the button is held down longer, Android opens up the soft keyboard on the bottom half of the screen. What phone do you have? Are you sure?

I've never once seen that happen and I just tried it and it doesn't work on my phone. Also, that sounds like a user problem. Don't try to subvert the user.

If the user REALLY wants to open a keyboard in your app, you should let them and if it's useless, they'll hit back and it will go away. A more concerning issue should be that your buttons are so close to the menu buttons.

Good thinking-outside-the-box answer, thanks. The phone is a Nexus One. My buttons are necessarily close to the edges of the screen, to keep as much screen estate as possible for the real action.

The fact that the "hardware" buttons are no more than an extension of the touch screen, without a tangible boundary, might be considered a design flaw in the phone... but I don't think the N1 is the only phone with this design. – Thomas Jan 14 at 14:06 Android 2.2 by the way. – Thomas Jan 14 at 14:12 @Thomas: Actually there's software to prevent accidental menu button presses.

Have you had this issue personally? I've almost never accidentally hit my menu buttons. On an original moto droid.

– Falmarri Jan 14 at 18:20 Not me personally, but someone who never used an N1 before. Maybe it's not as big an issue as I originally thought. – Thomas Jan 14 at 20:12 I think there are cases where you do want to prevent the user from opening a keyboard in your app.

A camera app showing preview frames is one example. The DroidX opens the soft keyboard by default on long press of menu. – Error 454 Jan 31 at 18:59.

Here is, at least, a solution to my immediate problem. It shows the in-game menu, no matter how long the button was pressed. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.

KEYCODE_MENU) { event.startTracking(); return true; } return super. OnKeyDown(keyCode, event); } @Override public boolean onKeyLongPress(int keyCode, KeyEvent event) { // From the docs: // "Note that in order to receive this callback, someone in the event chain // must return true from onKeyDown(int, KeyEvent) and call startTracking() on the event. " if (keyCode == KeyEvent.

KEYCODE_MENU) { // Override default handling, and don't pop up the soft keyboard. Return true; } return super. OnKeyDown(keyCode, event); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.

KEYCODE_MENU) { openOptionsMenu(); return true; } return super. OnKeyUp(keyCode, event); } But it feels like a hack, so I'm hoping that someone comes up with a better solution.

I am for think out of the box and all but sometimes you just want it to do a certain thing and you code helps accomplish exactly that. I don't know if I would call it a hack, probably feels that way because you have to just through some hoops to get it to work... Thanks! – bytebender Apr 19 at 16:14 I agree it's a hack - but it's a hack that works gloriously well.

Thank you very much; it's just what I needed (none of the other approaches worked for me, either). – Carl Manaster Jul 28 at 21:32.

Try using hideSoftInputFromWindow() instead. According to the documentation: request to hide the soft input window from the context of the window that is currently accepting input.

The soft keyboard is prevented (without quotes):. Prevent the soft keyboard.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions