client.post("http://192.168.10.7:8080/api/Notifications",params ,new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
System.out.println(response);
try {
// Create JSON object out of the response sent by getdbrowcount
JSONObject obj = new JSONObject(response);
System.out.println(obj.get("count"));
// If the count value is not zero, call MyService to display notification
if(obj.getInt("count") != 0){
Toast.makeText(context, "Service Started", Toast.LENGTH_SHORT).show();
final Intent intnt = new Intent(context, MyService.class);
// Set unsynced count in intent data
intnt.putExtra("intntdata", "Unsynced Rows Count "+obj.getInt("count"));
// Call MyService
context.startService(intnt);
}else{
Toast.makeText(context, "Sync not needed", Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
答案 0 :(得分:0)
500是内部服务器错误,这意味着网站服务器上出现了问题,但服务器无法确定具体问题。