app: [Android] avoid a null pointer exception at initialization

GioView.onCreateView may call methods on the imm field of GioView.
Make sure it is initialized before use.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-03-02 16:41:08 +01:00
parent 9b69233924
commit b0838bf697
+1 -1
View File
@@ -105,8 +105,8 @@ public final class GioView extends SurfaceView {
}
accessManager = (AccessibilityManager)context.getSystemService(Context.ACCESSIBILITY_SERVICE);
nhandle = onCreateView(this);
imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
nhandle = onCreateView(this);
setFocusable(true);
setFocusableInTouchMode(true);
focusCallback = new View.OnFocusChangeListener() {