简体   繁体   中英

Soft keyboard not come in WebView

My android app has a webview. Where i load a webpage to give user name and password. But now a problem is no soft keybord is not comming.Please help anyone.

May help you this code:

 webView.requestFocus(View.FOCUS_DOWN);
 webView.setOnTouchListener(new View.OnTouchListener()
   {
    @Override
     public boolean onTouch(View v, MotionEvent event)
    {
      switch (event.getAction())
      {
        case MotionEvent.ACTION_DOWN:
        case MotionEvent.ACTION_UP:
            if (!v.hasFocus())
            {
                v.requestFocus();
            }
            break;
       }
      return false;
    }
   });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM