2
votes

I have an edittext to which I have assigned a touch listener. But when I touch the editText the soft keyboard does not pop up. I have used InputMethodManager manager=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); manager.showSoftInput(roomLnEditTxt, InputMethodManager.SHOW_IMPLICIT);

but still not working.

3

3 Answers

2
votes

Use SHOW_FORCED instead of SHOW_IMPLICIT

InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(YOUR_VIEW, InputMethodManager.SHOW_FORCED);

This will definitely solve your problem.

0
votes

Add this line in the manifest

<activity android:name=".activity" android:configChanges="keyboardHidden|orientation">
0
votes
public boolean onTouch(View v, MotionEvent event) {
        //your code here 

        //Return false is the trick 
        return false;

Returning false solved the problem for me .