我得到HTTPPOST的響應,從中獲取一個是URL的子字符串,然後對其執行HTTPGET,我無法獲得任何響應。關於這個問題可能有什麼意見?異步任務中的HTTP GET不起作用
String pkmspogout1 = result.substring(result.indexOf(",")+1,result.length());
Log.i("Lpkmspogout1 ", pkmspogout1);
HttpClient httpclient4 = new DefaultHttpClient();
HttpResponse logoutresponse ;
try {
HttpGet httpget = new HttpGet(pkmspogout1);
logoutresponse = httpclient4.execute(httpget);
BufferedReader in2 = new BufferedReader(new InputStreamReader(logoutresponse.getEntity().getContent()));
StringBuffer sb2 = new StringBuffer("");
String line2 = "";
String NL2 = System.getProperty("line.separator");
while ((line2 = in2.readLine()) != null) {
sb2.append(line + NL2);
}
in2.close();
String pkmslogout5 = sb2.toString();
Log.i("logoutresponse from pkms", pkmslogout5+"");
} catch (Exception e) {}
很高興知道,當編碼器出現故障時,我認爲它對於url來說很簡單。我會建議修剪,但並不認爲這是問題。知道在將來建議它是很好的。 – msj121