Fetch Data from JSON using volley in Fragment
<p>I am trying to get data from a URL using volley everything is alright(no errors) but i can't see anything on opening the fragment not even progress dialogue. 
 You can find the reference here: <a href="http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/" rel="nofollow">Custom List View</a> i just want to use code in a Fragment.
Thanks in advance
here's my code:</p>

<pre><code>public class FragmentMain extends Fragment {
private static final String TAG = FragmentMain.class.getSimpleName();

// Movies json url
private static final String url = "http://api.example.com/json/movies.json";
private ProgressDialog pDialog;
private List&lt;Movie&gt; movieList = new ArrayList&lt;&gt;();
private CustomListAdapter adapter;
public FragmentMain() {
    // Required empty public constructor
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    ListView listView = (ListView) getActivity().findViewById(R.id.list);
    adapter = new CustomListAdapter(getActivity(), movieList);
    listView.setAdapter(adapter);

    pDialog = new ProgressDialog(getActivity());
    // Showing progress dialog before making http request
    pDialog.setMessage("Loading...");
    pDialog.show();


    // Creating volley request obj
    JsonArrayRequest movieReq = new JsonArrayRequest(url,
            new Response.Listener&lt;JSONArray&gt;() {
                @Override
                public void onResponse(JSONArray response) {
                    Log.d(TAG, response.toString());
                    hidePDialog();

                    // Parsing json
                    for (int i = 0; i &lt; response.length(); i++) {
                        try {

                            JSONObject obj = response.getJSONObject(i);
                            Movie movie = new Movie();
                            movie.setTitle(obj.getString("title"));
                            movie.setThumbnailUrl(obj.getString("image"));
                            movie.setRating(((Number) obj.get("rating"))
                                    .doubleValue());
                            movie.setYear(obj.getInt("releaseYear"));

                            // Genre is json array
                            JSONArray genreArry = obj.getJSONArray("genre");
                            ArrayList&lt;String&gt; genre = new ArrayList&lt;&gt;();
                            for (int j = 0; j &lt; genreArry.length(); j++) {
                                genre.add((String) genreArry.get(j));
                            }
                            movie.setGenre(genre);

                            // adding movie to movies array
                            movieList.add(movie);

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }

                    }

                    // notifying list adapter about data changes
                    // so that it renders the list view with updated data
                    adapter.notifyDataSetChanged();
                }
            }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            VolleyLog.d(TAG, "Error: " + error.getMessage());
            hidePDialog();

        }
    });

    // Adding request to request queue
    AppController.getInstance().addToRequestQueue(movieReq);

    // Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_main, container, false);
}

@Override
public void onDestroy() {
    super.onDestroy();
    hidePDialog();
}

private void hidePDialog() {
    if (pDialog != null) {
        pDialog.dismiss();
        pDialog = null;
    }
}
</code></pre>