mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-03-02 19:16:56 +00:00
Fix an auto-reported null pointer exception in NativeActivity, plus a couple of potential others.
Must be rare though..
This commit is contained in:
parent
ce05930811
commit
a0cff13efa
@ -814,7 +814,7 @@ public class NativeActivity extends Activity {
|
||||
toast.show();
|
||||
Log.i(TAG, params);
|
||||
return true;
|
||||
} else if (command.equals("showKeyboard")) {
|
||||
} else if (command.equals("showKeyboard") && mGLSurfaceView != null) {
|
||||
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
// No idea what the point of the ApplicationWindowToken is or if it
|
||||
// matters where we get it from...
|
||||
@ -822,7 +822,7 @@ public class NativeActivity extends Activity {
|
||||
mGLSurfaceView.getApplicationWindowToken(),
|
||||
InputMethodManager.SHOW_FORCED, 0);
|
||||
return true;
|
||||
} else if (command.equals("hideKeyboard")) {
|
||||
} else if (command.equals("hideKeyboard") && mGLSurfaceView != null) {
|
||||
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
inputMethodManager.toggleSoftInputFromWindow(
|
||||
mGLSurfaceView.getApplicationWindowToken(),
|
||||
@ -839,7 +839,7 @@ public class NativeActivity extends Activity {
|
||||
Log.i(TAG, "Launching inputbox: " + title + " " + defString);
|
||||
inputBox(title, defString, "OK");
|
||||
return true;
|
||||
} else if (command.equals("vibrate")) {
|
||||
} else if (command.equals("vibrate") && mGLSurfaceView != null) {
|
||||
int milliseconds = -1;
|
||||
if (params != "") {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user