requestFoucs(); is invalid.
requestFoucsFromTouch(); is invalid.
webview.setTouchListener; Invalid.
The problem:
When inheriting WebView, pay attention to the construction method:
public CommonWebView(Context context) { super(context); init(); } public CommonWebView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public CommonWebView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); }
##defStyleAttr cannot pass 0, the following is the wrong way to write it :
public CommonWebView(Context context) { this(context,null,0); } public CommonWebView(Context context, AttributeSet attrs) { this(context, attrs,0); } public CommonWebView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); }The above is the reason why Android WebView cannot pop up the soft keyboard and the solution introduced by the editor. I hope it will be helpful to everyone. If If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank you all for your support of the PHP Chinese website! For more related articles on the reasons and solutions for why Android WebView cannot pop up the soft keyboard, please pay attention to the PHP Chinese website!