基本上我在數據庫端設置了一些成員,我也做了一個註冊表單,它將數據發佈到數據庫,但是我遇到的問題是我的程序不會啓動活動。當我註釋掉它的工作部分的httppost部分時,所以我相信我的問題與PHP文件有關,但是已經發布了我已經完成的Java代碼。在另一個問題中,我將發佈PHP代碼。android httppost錯誤
try
{
httpclient = new default HttpClient();
httppost = new HttpPost("");
nameValuePair = new arrayList <NameValuePair> (1);
nameValuePair . add(new BasicNameValuePair("email", email . getText() . toString() . trim()));
nameValuePair . add(new BasicNameValuePair("password", password . getText() . toString() . trim()));
httppost . setEntity(new UrlEncodedF or mEntity(nameValuePair));
response = httpclient . execute(httppost);
ResponseHandler <String> responseHandler = new BasicResponseHandler();
final Stringresponse = httpclient . execute(httppost, responseHandler);
loginErrorMsg . setText("" + response);
if(response . equalsIgnorecase ("Log in Successful"))
{
startActivity(new Intent(LoginActivity . this, HomescreenActivity . class));
}
}
catch(Exceptione)
{
e.printStackTrace();
}
顯示完整的堆棧跟蹤 – moDev 2013-02-23 19:55:15
確定。謝謝你的回覆 – Moe 2013-02-27 15:22:03
02-27 15:35:31.791:W/KeyCharacterMap(118):沒有鍵盤的ID 0 02-27 15:35:31.791:W/KeyCharacterMap(118):使用默認鍵盤映射: system/usr/keychars/qwerty.kcm.bin 02-27 15:36:02.321:W/SingleClientConnManager(342):無效使用SingleClientConnManager:仍然分配連接。 02-27 15:36:02.321:W/SingleClientConnManager(342):確保在分配另一個連接之前釋放連接。 – Moe 2013-02-27 15:39:04