12-27 22:59:04.503 10514 10514 E AndroidRuntime: Caused by: java.lang.OutOfMemoryError: Failed to allocate a 40 byte allocation with 1602368 free bytes and 1564KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at java.lang.ref.FinalizerReference.add(FinalizerReference.java:61)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.XmlBlock.newParser(XmlBlock.java:89)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1211)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.ResourcesImpl.loadXmlDrawable(ResourcesImpl.java:904)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:860)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:668)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.Resources.loadDrawable(Resources.java:993)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:1007)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.TypedArray.getDrawable(TypedArray.java:982)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.graphics.drawable.StateListDrawable.inflateChildElements(StateListDrawable.java:182)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:126)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:145)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1399)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1358)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.ResourcesImpl.loadXmlDrawable(ResourcesImpl.java:906)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:860)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:668)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.Resources.loadDrawable(Resources.java:993)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:1007)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.content.res.TypedArray.getDrawable(TypedArray.java:982)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.widget.AbsListView.<init>(AbsListView.java:897)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.widget.ListView.<init>(ListView.java:231)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.widget.ListView.<init>(ListView.java:227)
12-27 22:59:04.503 10514 10514 E AndroidRuntime: at android.widget.ListView.<init>(ListView.java:223)
AndroidManifest的application属性:
android:hardwareAccelerated=“ture” 启动硬件加速
android:largeHeap=“true” 应用能申请使用更多的内存