I am experiencing an issue with intent.getBooleanExtra
that is triggering an OutOfMemoryError
exception.
The crash occurred on an Android 5.0 phone (Asus ZenFone 2 ZE551ML), with more than 1GB of free RAM and more than 6GB of free disk space.
Crash stack:
Fatal Exception: java.lang.OutOfMemoryError: int[] of length 2015679692 would overflow at android.util.ArrayMap.allocArrays(ArrayMap.java:198) at android.util.ArrayMap.ensureCapacity(ArrayMap.java:309) at android.os.BaseBundle.unparcel(BaseBundle.java:219) at android.os.BaseBundle.getBoolean(BaseBundle.java:658) at android.os.Bundle.getBoolean(Bundle.java:603) at android.content.Intent.getBooleanExtra(Intent.java:4781) at MyClass.onActivityCreated(MyClass.java:33)
And my code looks like:
@Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { Intent intent = activity.getIntent(); if (intent != null && !intent.getBooleanExtra(ActionIntent.MYCONSTANT, false)) { .... } }
Any Idea why I got that crash, with just the getBooleanExtra
call and with more than 1GB of free RAM?