mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 22:53:23 +00:00
Fixed bug #13306 - workaround for android issue "java.lang.NullPointerException android.view.View.onResolvePointerIcon"
This commit is contained in:
parent
244ae39b30
commit
10885f4b7e
1 changed files with 11 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ import android.view.Display;
|
|||
import android.view.InputDevice;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.PointerIcon;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
|
|
@ -360,6 +361,16 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||
}
|
||||
}
|
||||
|
||||
// Prevent android internal NullPointerException (https://github.com/libsdl-org/SDL/issues/13306)
|
||||
@Override
|
||||
public PointerIcon onResolvePointerIcon(MotionEvent event, int pointerIndex) {
|
||||
try {
|
||||
return super.onResolvePointerIcon(event, pointerIndex);
|
||||
} catch (NullPointerException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Captured pointer events for API 26.
|
||||
@Override
|
||||
public boolean onCapturedPointerEvent(MotionEvent event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue