title: My list from JSON not showing on listview in mobile application, why?
body: <p>This is my code. What can I change?</p>
  <p>Notification fragment</p>
  <pre><code>public class NotificationsFragment extends Fragment {
      private ArrayList&lt;String&gt; arrayList;
      private ListView listView;
      private RequestQueue queue;
      private ArrayAdapter arrayAdapter;
  
      private List&lt;Earthquake&gt; quakeList;
      private int contentView;
      private View view;
  </code></pre>
  <p>I think I have problem with this <code>listview</code> and this line of code: <code>listView  = getActivity().findViewById(R.id.listview)</code> . I try to fix this but no success.</p>
  <pre><code>    @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.fragment_notifications);
  
          quakeList = new ArrayList&lt;&gt;();
          listView  = getActivity().findViewById(R.id.listview);
  
          queue =  Volley.newRequestQueue(getActivity().getApplicationContext());
  
          arrayList = new ArrayList&lt;&gt;();
  
          getAllQuakes(Constants.URL);
  
      }
  </code></pre>
  <p>The rest of the code.What can i return to show list?</p>
  <pre><code>    private void setContentView(int fragment_notifications) {
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          view = inflater.inflate(R.layout.fragment_notifications, container, false);
          return view;
      }
  
  
           void getAllQuakes(String url) {
  
                                      JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET,
                                              url, new Response.Listener&lt;JSONObject&gt;() {
                                          @Override
                                          public void onResponse(JSONObject response) {
                                              Earthquake earthquake = new Earthquake();
  </code></pre>
  <p>How can I send from console to listview? Should I change something?</p>
  <pre><code>                                            try {
                                                  JSONArray features = response.getJSONArray(&quot;features&quot;);
                                                  for (int i = 0; i &lt; Constants.LIMIT; i++) {
                                                      JSONObject properties = features.getJSONObject(i).getJSONObject(&quot;properties&quot;);
                                                      JSONObject geometry = features.getJSONObject(i).getJSONObject(&quot;geometry&quot;);
  
                                                      JSONArray coordinates = geometry.getJSONArray(&quot;coordinates&quot;);
  
                                                      double lon = coordinates.getDouble(0);
                                                      double lat = coordinates.getDouble(1);
  
                                                      //Log.d(&quot;Quake&quot;, lon + &quot;, &quot; + lat);
                                                      Log.d(&quot;Lat&quot;, properties.getString(&quot;place&quot;));
  
                                  earthquake.setPlace(properties.getString(&quot;place&quot;));
                                  earthquake.setType(properties.getString(&quot;type&quot;));
                                  earthquake.setTime(properties.getLong(&quot;time&quot;));
                                  earthquake.setMagnitude(properties.getDouble(&quot;mag&quot;));
                                  earthquake.setLon(lon);
                                  earthquake.setLat(lat);
  
                                  arrayList.add(earthquake.getPlace());
  
                              }
  </code></pre>
  <p>ArrayAdapter:</p>
  <pre><code>    final ArrayAdapter adapter = new ArrayAdapter&lt;String&gt;(getActivity(),
                                      android.R.layout.simple_list_item_1, arrayList);
                              listView.setAdapter(adapter);
                              listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                                  @Override
                                  public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                                      //Toast.makeText(getApplicationContext(), &quot;Clicked &quot; + position, Toast.LENGTH_LONG).show();
                                      Toast.makeText(getActivity(), &quot;Clicked&quot;+ position,Toast.LENGTH_LONG).show();
  
                                  }
                              });
                              arrayAdapter.notifyDataSetChanged();
  </code></pre>