我正在调用网络服务在地图上绘制点。我在回复中找到了 750 条记录。当页面第二次加载时,它向我显示了这个错误。
致命异常: org.apache.http.util.CharArrayBuffer.toString(CharArrayBuffer.java:261) 的 java.lang.String.(String.java:513) 的 org.apache.http 的 Thread-26 java.lang.OutOfMemoryError .util.EntityUtils.toString(EntityUtils.java:141) 在 org.apache.http.util.EntityUtils.toString(EntityUtils.java:146) 在 org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java :76) 在 org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657) 上的 org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:59)。 http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:627) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:616) at com.roundmenu.Nearme.run(Nearme.java: 583)在java.lang。线程.run(线程.java:1019)
@Override
public void run() {
try {
HttpGet post = null;
Log.e("", "Share.isfromfilter = " + Share.isfromfilter);
if (Share.isfromfilter) {
Log.e("", "Teset 1");
Log.e("", "Share.CuisineValue = " + Share.CuisineValue);
if (Share.CuisineValue.equalsIgnoreCase("")) {
Log.e("", "Teset 2");
post = new HttpGet("my url here");
} else {
Log.e("", "Teset 3");
post = new HttpGet("my url here");
}
} else {
Log.e("", "Teset 4");
post = new HttpGet("my url here");
}
post.addHeader("apikey", "880639B3638597349AC1BE6F70FC5682");
ResponseHandler<String> responseHandler = new BasicResponseHandler();
response = client.execute(post, responseHandler);
System.out.println("----------------------------------------");
System.out.println(response);
handler.sendEmptyMessage(0);
} catch (Exception e) {
e.printStackTrace();
handler.sendEmptyMessage(1);
}
}
在执行此代码期间,我也收到了 VM Out of Budget 错误。