【发布时间】:2016-02-26 09:30:08
【问题描述】:
当我尝试将 json 响应转换为字符串时,我遇到了 OutofMemoryError 异常
这是我试过的代码
HttpEntity entity = response.getEntity();
if(entity != null) {
contentAsString = EntityUtils.toString(entity); // error
}
我也尝试过使用 volley 和 Retrofit Network 库,但遇到了同样的问题。请建议...
【问题讨论】:
-
你在模拟器或设备上试过了吗?
-
尝试将
android:largeHeap="true"添加到清单中? -
你收到base64编码的图片了吗?
-
您可以控制您的后端吗?你的 json 响应有多大?
标签: android json jackson out-of-memory android-volley