0
在嘗試執行以下操作時出現URISyntaxException異常。我完全不知道是什麼導致了這個問題。得到一些幫助是很好的。該錯誤位於最後一行嘗試構建httpget鏈接時出現URISyntaxException
EditText edUserName = (EditText)findViewById(R.id.textBox_username_register);
String strUsernameTemp = edUserName.getText().toString();
byte[] byteUsernameTemp = null;
try
{
byteUsernameTemp = strUsernameTemp.getBytes("UTF-8");
}
catch(UnsupportedEncodingException e)
{
e.printStackTrace();
}
String strUsername = Base64.encodeToString(byteUsernameTemp, Base64.DEFAULT);
EditText edPassword = (EditText)findViewById(R.id.passwordBox_password_register);
String strPasswordTemp = edPassword.getText().toString();
byte[] bytePasswordTemp = null;
try
{
bytePasswordTemp = strPasswordTemp.getBytes("UTF-8");
}
catch(UnsupportedEncodingException e)
{
e.printStackTrace();
}
String strPassword = Base64.encodeToString(bytePasswordTemp, Base64.DEFAULT);
EditText edEmail = (EditText)findViewById(R.id.textBox_email_register);
String strEmailTemp = edEmail.getText().toString();
byte[] byteEmailTemp = null;
try
{
byteEmailTemp = strEmailTemp.getBytes("UTF-8");
}
catch(UnsupportedEncodingException e)
{
e.printStackTrace();
}
String strEmail = Base64.encodeToString(byteEmailTemp, Base64.DEFAULT);
String strD = "22";
String strM = "11";
String strY = "1993";
StringBuilder builder = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpGet httpget = new HttpGet(loginData.strAPIURL + "addUser&username=" + strUsername + "&password=" + strPassword + "&email=" + strEmail + "&d=" + strD + "&m=" + strM + "&y=" + strY); // this line causes the error
可以發表'loginData.strAPIUR'的值嗎? – 2013-04-09 11:28:22