Caused by: java.lang.OutOfMemoryError: Failed to allocate a 67122084 byte allocation with 1037008 free bytes and 63MB until OOM
解决Android 内存溢出
其实你可以添加在你的清单
android:hardwareAccelerated="false"
android:largeHeap="true"
即关闭硬加速,因为他比较消耗内存,另外开启最大内存。
但并不是所有项目都应该使用这样的方法去解决OutOfMemoryError问题,如果是大图片和视频应用可以使用android:largeHeap="true";
<application
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
本文介绍了解决Android应用中内存溢出(OutOfMemoryError)的方法,通过调整清单文件中的配置,如关闭硬件加速和启用大堆内存,来优化内存使用。适用于处理大图片和视频的应用场景。
9842

被折叠的 条评论
为什么被折叠?



