mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
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:
+1
-1
@@ -105,8 +105,8 @@ public final class GioView extends SurfaceView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
accessManager = (AccessibilityManager)context.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
accessManager = (AccessibilityManager)context.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||||
nhandle = onCreateView(this);
|
|
||||||
imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
nhandle = onCreateView(this);
|
||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
setFocusableInTouchMode(true);
|
setFocusableInTouchMode(true);
|
||||||
focusCallback = new View.OnFocusChangeListener() {
|
focusCallback = new View.OnFocusChangeListener() {
|
||||||
|
|||||||
Reference in New Issue
Block a user