Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard not shown when i click on edittextview in android?

When i click on the edittextview then some times keyboard shown or some times keyboard are not shown.

In android 2.1 it show the keyboard when i click on the edittextview

but when i start same application it on android 2.2 then it not show the keyboard.

Help me how to show that problem.

like image 667
user642347 Avatar asked Aug 08 '11 04:08

user642347


2 Answers

OK, This might be a late response, but it worked.

I have met this problem on android 2.1 and 2.3.x(not tested on other versions of SDKs).

I noticed a strange thing that when my click on the EditText was unable to open the keyboard, I pressed the BACK button to show an alert dialog and then I canceled(closed) it, and clicked the EditText again, now the keyboard was brought to life again.

From that I can conclude that the keyboard will always show for the EditText if the EditText does not previously own focus(showing an alert dialog over the EditText view will make the EditText to lose focus).

so call the function below on your EditText when it is brought to front:

mEditText.clearFocus();

or

parentViewThatContainsEditTextView.clearFocus();
like image 115
neevek Avatar answered Sep 22 '22 10:09

neevek


I had a similar problem on Galaxy S3 (displaying EditText controls on a PopupWindow - the keyboard was never showing). This solved my issue:

final PopupWindow popUp = new PopupWindow(vbl.getMainLayout());
[....]
popUp.setFocusable(true);
popUp.update();
like image 35
kosiara - Bartosz Kosarzycki Avatar answered Sep 20 '22 10:09

kosiara - Bartosz Kosarzycki