Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Something doesn’t work for me (the text keyboard pops up when you enter in the input webview field. The inputtype (html) attribute cannot be changed from text to number. Dear experts, how to do what would happen when entering in < .input inputtype="text"> (page loaded in webview) did you open the numeric keypad TYPE_CLASS_PHONE?
public class CustomWebView extends WebView {
public CustomWebView(Context context) {
super(context);
}
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = super.onCreateInputConnection(outAttrs);
outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
return inputConnection;
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
Activity activity = new Activity();
View vwf = activity.getCurrentFocus();
InputMethodManager inputManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.restartInput(vwf);
setFocusable(true);
}
}//class
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question