简体   繁体   English

我在浏览器上发布链接时在浏览器中显示数据时,在Android广播代码中收到错误500,获取通知asp.net api的数据

[英]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.

相关问题 当我通过Android将POST数据发送到ASP.NET MVC站点时,为什么会出现错误500? - Why do I get an error 500 when I send POST data to an ASP.NET MVC site through Android? Android http发布到ASP.NET Web API不能插入数据 - Android http post to ASP.NET Web API not insert data 当我尝试将数据发布到Android应用程序上的Mvc Restful API时出现错误 - Getting error when I try to post data to Mvc Restful api on my android app 在我的代码中出现错误 500 但在我的浏览器中没有 - Getting a error 500 in my code but not in my browser 使用Android浏览器进行ASP.NET Forms身份验证 - ASP.NET Forms Authentication with Android Browser 在android中打开链接时显示浏览器列表 - Show browser list when opening a link in android 从浏览器链接获取数据到应用程序 - Getting data to app with intent from browser link 当任何浏览器在android上保存文件时,是否发送了广播? 如何在Android的浏览器中拦截保存/下载的文件? - When any browser saves a file on android, is there a broadcast sent? How can I intercept saved/downloaded files in a browser on Android? Android Chrome浏览器中的Notification API - Notification API in Android Chrome browser 我正在尝试导入从github获得的Open Data Kit Sc,但我一直遇到错误(我是android的新手) - I'm trying to import Open Data Kit Sc that i got from github, but i kept getting error (I'm new to android)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM