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 ;
@@ -766,6 +767,18 @@ public boolean checkPermission(String permission) {
766767 return false ;
767768 }
768769 }
770+
771+ public void openKeyboard () {
772+ Context context = surface .getContext ();
773+ InputMethodManager imm = (InputMethodManager )context .getSystemService (Context .INPUT_METHOD_SERVICE );
774+ imm .toggleSoftInput (InputMethodManager .SHOW_FORCED ,0 );
775+ }
776+
777+ public void closeKeyboard () {
778+ Context context = surface .getContext ();
779+ InputMethodManager imm = (InputMethodManager )context .getSystemService (Context .INPUT_METHOD_SERVICE );
780+ imm .toggleSoftInput (InputMethodManager .HIDE_IMPLICIT_ONLY , 0 );
781+ }
769782
770783
771784 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
You can’t perform that action at this time.
0 commit comments