0
我在執行JsonObjectRequest時遇到問題,因爲您在網上獲取JsonObject。 我想創建一個新的JsonObjectRequest:在執行JsonObjectRequest時遇到問題
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
JSONObject ratesJsonObj = response.getJSONObject("rates");
String RON = ratesJsonObj.getString("RON");
Log.v("Currency", RON);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
但一切這一切都彎彎曲曲的下由Android工作室紅色白標明的,它說
Error:(41, 47) error: reference to JsonObjectRequest is ambiguous, both constructor
JsonObjectRequest(int,String,String,Listener<JSONObject>,ErrorListener)
in JsonObjectRequest and constructor
JsonObjectRequest(int,String,JSONObject,Listener<JSONObject>,ErrorListener)
in JsonObjectRequest match
沒有人有任何的想法有什麼不對?
坦克很多@Oleg Khalidov ... thtat小投我抱回:) – Adrian