Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java &引用;org.json.JSONObject“;“失踪”;Request.Method.GET";及;com.android.volley“;JsonObjectRequest参数似乎顺序错误_Java_Android_Json - Fatal编程技术网

Java &引用;org.json.JSONObject“;“失踪”;Request.Method.GET";及;com.android.volley“;JsonObjectRequest参数似乎顺序错误

Java &引用;org.json.JSONObject“;“失踪”;Request.Method.GET";及;com.android.volley“;JsonObjectRequest参数似乎顺序错误,java,android,json,Java,Android,Json,我试图使用“com.android.volley”模块的JSONObject请求对一些Json数据发出GET请求 android开发页面(谷歌自己的网站)显示如下设置: JsonObjectRequest jsonObjectRequest = new JsonObjectRequest (Request.Method.GET, url, null, new Response.Listener<JSONObject>() { ... } ); 我的构建依赖项中还有实

我试图使用“com.android.volley”模块的JSONObject请求对一些Json数据发出GET请求

android开发页面(谷歌自己的网站)显示如下设置:

JsonObjectRequest jsonObjectRequest = new JsonObjectRequest
        (Request.Method.GET, url, null, new Response.Listener<JSONObject>() { ... } );
我的构建依赖项中还有
实现'com.android.volley:volley:1.1.1'
。 我尝试了1.0.0和1.1.0,都没有解决我的问题。

您使用了

new JsonObjectRequest(getString(R.string.getAddress), Request.Method.GET, null, new Response.Listener<JSONObject>(){...});

试试这个:

JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, "URL", null, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                
            }
        },null);
JsonObjectRequest-JsonObjectRequest=newjsonobjectrequest(Request.Method.GET,“URL”,null,new Response.Listener()){
@凌驾
公共void onResponse(JSONObject响应){
}
},空);
您已使用

new JsonObjectRequest(getString(R.string.getAddress), Request.Method.GET, null, new Response.Listener<JSONObject>(){...});

试试这个:

JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, "URL", null, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                
            }
        },null);
JsonObjectRequest-JsonObjectRequest=newjsonobjectrequest(Request.Method.GET,“URL”,null,new Response.Listener()){
@凌驾
公共void onResponse(JSONObject响应){
}
},空);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, "URL", null, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                
            }
        },null);