mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
Fix NPE in MainActivity.onDialogCompleted by guarding showSoftInput call with null focus check
This commit is contained in:
@@ -468,17 +468,16 @@ public class MainActivity extends NativeActivity {
|
|||||||
|
|
||||||
_userInputStatus = 1;
|
_userInputStatus = 1;
|
||||||
InputMethodManager inputManager = (InputMethodManager)getSystemService("input_method");
|
InputMethodManager inputManager = (InputMethodManager)getSystemService("input_method");
|
||||||
boolean result = inputManager.showSoftInput(this.getCurrentFocus(), InputMethodManager.SHOW_IMPLICIT);
|
View focused = this.getCurrentFocus();
|
||||||
|
if (focused != null) {
|
||||||
|
boolean result = inputManager.showSoftInput(focused, InputMethodManager.SHOW_IMPLICIT);
|
||||||
|
} else {
|
||||||
|
// fallback: try to show using decor view token
|
||||||
|
View decor = getWindow().getDecorView();
|
||||||
|
if (decor != null) {
|
||||||
|
inputManager.showSoftInput(decor, InputMethodManager.SHOW_IMPLICIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onStart() {
|
|
||||||
//System.out.println("onStart");
|
|
||||||
super.onStart();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onResume() {
|
|
||||||
//System.out.println("onResume");
|
|
||||||
super.onResume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
|
|||||||
Reference in New Issue
Block a user