6

I'm trying to keep the keyboard up, at all times. I don't want the back button to hide it. I don't want anything to hide it.

I've dumped android:windowSoftInputMode="stateAlwaysVisible" in the manifest, though it seems the team that built this feature should google the definition of "always"

When I press the back button on my app it hides the keyboard.

Is there a way to catch and kill the first back button click, or pass it up to the activity and not have the keyboard hide?

EDIT


Overriding any of these and putting break points on every line shows me one thing, none of these get called. The keyboard is hidden, and my activity didn't have have a clue.
 public boolean onKeyLongPress(int keyCode, KeyEvent event){
 public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event){
 public boolean onKeyUp(int keyCode, KeyEvent event){
 public boolean onKeyDown(int keyCode, KeyEvent event) {
 public void onBackPressed() {
baash05
  • 4,394
  • 11
  • 59
  • 97

1 Answers1

0

Is there a way to catch and kill the first back button click, or pass it up to the activity and not have the keyboard hide?

Yes. Just use the following code:

@Override
    public void onBackPressed() {
       //do nothing,hence avoiding the soft keyboard from hiding
       return;
    }
Kazekage Gaara
  • 14,972
  • 14
  • 61
  • 108
  • Nope.. keyboard catches it before that gets called. The keyboard goes away. – baash05 May 30 '12 at 14:44
  • Yeah.. that's where I got the, alwaysvisible lie.. The idea of writing my own graffiti interpreter is ugly, and sometimes, I like to use swipe, or the stock keyboard. I was hoping the topic had moved on, from 2009. – baash05 May 30 '12 at 22:13
  • Also, much of the conversation is about how to show the keyboard. Alwaysvisible does manage to show the keyboard when I start the app. When I hit the back button however, the keyboard goes away. I don't want it to goaway. I want the app to bring the user back a screen (or out of my app) – baash05 May 30 '12 at 22:17