hi, I've tried to run keyboard on android and I get an error. the error is: the function getSystemService does not exist. here is the code.
import android.view.inputmethod.InputMethodManager;
import android.content.Context;
boolean showing=false;
void setup() {
fullScreen();
}
void draw() {
if (showing)
showVirtualKeyboard();
else
hideVirtualKeyboard();
}
void mousePressed() {
showing=true;
}
void showVirtualKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
void hideVirtualKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
}
anybody knows why?