final String message [] = {「」,「」,「」};請求日期顯示解決方案
try{
String UID = null, UBAL = null;
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar PDate;
ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("UserID",id.getId()));
response = connection.executeHttpPost("http://condoproject.net16.net/PayCheck.php", postParameters);
Toast.makeText(getApplicationContext(), ""+response, Toast.LENGTH_LONG).show();
JSONArray jArray = new JSONArray(response);
for(int i = 0; i<jArray.length();i++)
{
JSONObject json_data= (JSONObject) jArray.get(i);
Toast.makeText(getApplicationContext(), ""+json_data, Toast.LENGTH_LONG).show();
UID = json_data.getString("UserID");
UBAL = json_data.getString("UPayment");
Uid1.setText(UID);
ubal.setText(UBAL);
PDate = (Calendar) json_data.get("PayDate");
PDate.add(Calendar.MONTH, 1);
String P = ""+PDate;
Udate.setText(P);
}
UserID和Balance可以顯示,但僅限於日期textview爲空。我可以知道這個解決方案嗎?