Skip to content

Commit

Permalink
On older Android versions, densityDpi can't change and is thus not pr…
Browse files Browse the repository at this point in the history
…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 61e38b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android/src/org/ppsspp/ppsspp/NativeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 61e38b4

Please sign in to comment.