File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 3333import java .util .regex .*;
3434import java .util .zip .*;
3535
36+ import android .view .inputmethod .InputMethodManager ;
3637import android .app .Activity ;
3738import android .content .*;
3839import android .content .pm .PackageManager ;
@@ -768,6 +769,18 @@ public boolean checkPermission(String permission) {
768769 return false ;
769770 }
770771 }
772+
773+ public void openKeyboard () {
774+ Context context = surface .getContext ();
775+ InputMethodManager imm = (InputMethodManager )context .getSystemService (Context .INPUT_METHOD_SERVICE );
776+ imm .toggleSoftInput (InputMethodManager .SHOW_FORCED ,0 );
777+ }
778+
779+ public void closeKeyboard () {
780+ Context context = surface .getContext ();
781+ InputMethodManager imm = (InputMethodManager )context .getSystemService (Context .INPUT_METHOD_SERVICE );
782+ imm .toggleSoftInput (InputMethodManager .HIDE_IMPLICIT_ONLY , 0 );
783+ }
771784
772785
773786 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
You can’t perform that action at this time.
0 commit comments