錯誤代碼:java
java.lang.OutOfMemoryError: Failed to allocate a 74126220 byte allocation with 4190480 free bytes and 61MB until OOMandroid
錯誤緣由:bash
內存超了app
解決方法:spa
一、處理圖片和視頻減小加載量線程
二、開啓多個線程,避免全部處理都在主線程中處理code
三、在AndroidManifest.xml文件中的application標籤中添加以下四行代碼就解決問題了視頻
android:allowBackup="true" android:supportsRtl="true" android:largeHeap="true" android:hardwareAccelerated="false"
以下:
<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">