[英]I got Error 500 in android broadcast code getting data for notification asp.net api when i post link on browser it show data in browser
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();
}
}
500是内部服务器错误,这意味着网站的服务器出了点问题,但是服务器无法更确切地说明确切的问题是什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.