12345678910111213141516171819202122232425262728 |
- var Context,
- InputMethodManager,
- main,
- imm;
- function initKeyboardAndroid(){
- if(plus.android.runtimeMainActivity){
- plus.android.importClass(plus.android.currentWebview());
-
- Context = plus.android.importClass("android.content.Context");
- InputMethodManager = plus.android.importClass("android.view.inputmethod.InputMethodManager");
- main = plus.android.runtimeMainActivity();
- imm = main.getSystemService(Context.INPUT_METHOD_SERVICE);
- }
- }
- function openSoftKeyboard() {
- if(!plus.android.runtimeMainActivity) {
- plus.webview.currentWebview().nativeInstanceObject()
- .plusCallMethod({
- "setKeyboardDisplayRequiresUserAction": false
- });
- } else {
- plus.android.currentWebview().requestFocus();
- imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
- }
- }
|