-1

I'm trying to parse json to recyclerview in a fragment but i'm getting "Cannot Resolve Symbol ListItem " Error in loadData method !! i don't know what to do. please help me

Here is my code :

private void loadData() {
    ProgressDialog progressDialog =  new ProgressDialog(getActivity());
    progressDialog.setMessage("Loading...");
    progressDialog.show();
    StringRequest stringRequest = new StringRequest(Request.Method.GET, URL_DATA, new Response.Listener<String>() {
        @Override
        public void onResponse(String response) {

            try {
                JSONObject jsonObject = new JSONObject(response);
                JSONArray array = jsonObject.getJSONArray("data");
                for(int i =0;i<array.length();i++)
                {
                    JSONObject o = array.getJSONObject(i);
   -->**Cannot Resolve Symbol ListItem **    ListItem item = new ListItem(        
                            o.getString("_id"),
                            o.getString("store_textposition")
                    );
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    },
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {

                }
            });
    RequestQueue requestQuene = Volley.newRequestQueue(getActivity());
    requestQuene.add(stringRequest);
}

Whats' the Problem?

1 Answers1

0

You don't show enough to diagnose your problem, but it sounds like you failed to import the type. If you did import the type, then the import directive would have the same error, and that would mean that you have a classpath problem.

Lew Bloch
  • 3,364
  • 1
  • 16
  • 10