我得到一個ClassCastException:我使用Apache libray從下面的代碼Android的HTTP類轉換異常
try {
se = new StringEntity(myJson);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
httppost.setEntity(se);
httppost.setHeader("Accept", "application/json");
httppost.setHeader("Content-type", "application/json");
ResponseHandler responseHandler = new BasicResponseHandler();
try {
HttpResponse response = httpclient.execute(httppost, responseHandler);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
java.lang.String中。有沒有我看不到的演員陣容,對事業的任何幫助表示讚賞。可能是setEntity(se)調用?
請發佈堆棧跟蹤;我們沒有ESP :) –