diff --git a/apk/app/src/main/java/com/fgl27/twitch/Tools.java b/apk/app/src/main/java/com/fgl27/twitch/Tools.java index eb9c4e667..e46fdfa98 100644 --- a/apk/app/src/main/java/com/fgl27/twitch/Tools.java +++ b/apk/app/src/main/java/com/fgl27/twitch/Tools.java @@ -689,11 +689,13 @@ static int DeviceRam(Context context) { } else { return maxRamSize / 20; } - int ramSize = (int) (memInfo.totalMem / 20); + int ramSize = (int) memInfo.totalMem; //Prevent Ram too big bigger then max int value //Or just too big even on devices with a lot of RAM it can't be too large - return ramSize > maxRamSize || ramSize < 0 ? maxRamSize : ramSize; + ramSize = ramSize > maxRamSize || ramSize < 0 ? maxRamSize : ramSize; + + return ramSize / 20; } static String getWebviewVersion(Context context) {