0
在我的Android應用程序中,我使用用戶名和密碼註冊用戶,如果正確完成,則返回值「1」,如果不是則通過調用帶有用戶名和密碼的URL作爲參數的「0」並且結果0或1顯示在html正文中。從html正文中讀取文本
我的註冊是完全做,但HTML結果0或1沒有顯示,而不是顯示
[email protected]
,我寫了一個代碼閱讀HTML數據
public String getDataFromURL(String urlString) throws Exception {
String response="";
URL url = new URL(urlString);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
try {
InputStream in = new BufferedInputStream(urlConnection.getInputStream());
//readStream(in);
response = in.toString();
}
finally {
urlConnection.disconnect();
}
return response;
}
現在什麼我應該如何獲得html正文文本?
謝謝
非常感謝你:) – fean
你的大多是歡迎。 –