Permalink
Browse files

On older Android versions, densityDpi can't change and is thus not pr…

…esent in the Configuration objects.

Fixes crash opening/closing the Xperia Play (and probably lots of others).
  • Loading branch information...
hrydgard committed Oct 27, 2018
1 parent 5807ad0 commit 61e38b45394dbfd47c34238982a65bae9bce8ad1
Showing with 3 additions and 1 deletion.
  1. +3 −1 android/src/org/ppsspp/ppsspp/NativeActivity.java
@@ -783,7 +783,9 @@ public void onConfigurationChanged(Configuration newConfig) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
updateSystemUiVisibility();
}
densityDpi = (float) newConfig.densityDpi;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
densityDpi = (float) newConfig.densityDpi;
}
}
// keep this static so we can call this even if we don't

0 comments on commit 61e38b4

Please sign in to comment.