title: Arraylist become null
body: <p>I am getting id from previous activity,if id is null then i parse data and store it in arraylist,but if it is not null then i dont parse data and trying to set arraylist in listview,but it shows arraylist null</p>
  
  <pre><code>       mRecyclerView = (ListView) findViewById(R.id.filter_orderlist);
          makeJsonArrayRequestCountry();
  
      }
  
  
      private void makeJsonArrayRequestCountry() {
  
          showpDialog();
          JsonArrayRequest req = new JsonArrayRequest( filter_url,
                  new Response.Listener&lt;JSONArray&gt;() {
                      @Override
                      public void onResponse(JSONArray response) {
                          Log.d("ress", response.toString());
  
                          filterList =new ArrayList&lt;FilterModelClass&gt;();
                          // Parsing json
                          for (int i = 0; i &lt; response.length(); i++) {
                              try {
  
                                  JSONObject obj = response.getJSONObject(i);
  
                                  String heder=obj.getString("filterName");
  
                                  System.out.println("Hader"+heder);
  
                                  JSONArray details=obj.getJSONArray("getParam");
                                  for(int j=0;j&lt;details.length();j++)
                                  {
  
                                      JSONObject det=details.getJSONObject(j);
                                      FilterModelClass movie = new FilterModelClass();
                                      movie.setFilter_Name(det.getString("paramName"));
                                      String cityid=movie.setFilter_ID(det.getString("paramId"));
                                      filterList.add(movie);
  
                                  }
  
                                  mAdapter = new MyCustomBaseAdapter(FilterListActivity.this,filterList);
                                  mRecyclerView.setAdapter(mAdapter);
  
                                  btnSelection.setOnClickListener(new View.OnClickListener() {
  
                                      @Override
                                      public void onClick(View v) {
                                          String data = "";
                                          List&lt;FilterModelClass&gt; stList = ((MyCustomBaseAdapter) mAdapter)
                                                  .getStudentist();
  
                                          for (int i = 0; i &lt; stList.size(); i++) {
                                              FilterModelClass singleStudent = stList.get(i);
                                              if (singleStudent.isselected() == true) {
  
                                                  data = data+singleStudent.getFilter_ID().toString()+",";
  
                                              }
  
                                          }
                                          Intent intent=new Intent();
                                          intent.putExtra("filterid",data);
                                          setResult(RESULT_OK, intent);
                                          FilterListActivity.this.finish();
  
                                          Toast.makeText(FilterListActivity.this,
                                                  "Selected Students:" + data, Toast.LENGTH_LONG)
                                                  .show();
  
  
                                      }
                                  });
                              } catch (JSONException e) {
                                  e.printStackTrace();
                              }
  
                          }
  
                          // notifying list adapter about data changes
                          // so that it renders the list view with updated data
  
                          hidepDialog();
  
                      }
                  }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  VolleyLog.d("ErrorVolley", "Error: " + error.getMessage());
                  Toast.makeText(getApplicationContext(),
                          error.getMessage(), Toast.LENGTH_SHORT).show();
                  hidepDialog();
  
              }
          });
  
          MyApplication.getInstance().addToReqQueue(req, "jreq");
      }
  
  
      private void showpDialog() {
          if (!pDialog.isShowing())
              pDialog.show();
      }
  
      private void hidepDialog() {
          if (pDialog.isShowing())
              pDialog.dismiss();
      }
  
  
  
      @Override
      public void onClick(View v) {
  
          switch (v.getId()) {
  
  
              default:
                  break;
          }
  
      }
  
  
  
  
      public class MyCustomBaseAdapter extends BaseAdapter  {
          private  List&lt;FilterModelClass&gt; searchArrayList;
          ViewHolder holder;
          private LayoutInflater mInflater;
          SharedPreferences.Editor editor;
          Context context;
  
          public MyCustomBaseAdapter(Context mainActivity, List&lt;FilterModelClass&gt; results) {
              context = mainActivity;
              searchArrayList = results;
              mInflater = LayoutInflater.from(context);
          }
  
          public int getCount() {
              return searchArrayList.size();
  
          }
  
          public Object getItem(int position) {
              return searchArrayList.get(position);
          }
  
          public long getItemId(int position) {
              return position;
          }
  
          public View getView(final int position, View convertView, ViewGroup parent)
          {
              SharedPreferences sharedPrefs = context.getSharedPreferences("sharedPrefs", Context.MODE_PRIVATE);
  
  
              if (convertView == null) {
                  convertView = mInflater.inflate(R.layout.sorting_items, null);
                  holder = new ViewHolder();
                  holder.txtName = (TextView) convertView.findViewById(R.id.tvName);
                  holder.cB = (CheckBox)convertView.findViewById(R.id.chkSelected);
  
                  convertView.setTag(holder);
              }
              else {
                  holder = (ViewHolder) convertView.getTag();
              }
  
  
              editor = sharedPrefs.edit();
  
              holder.txtName.setText(searchArrayList.get(position).getFilter_Name());
  
              holder.cB.setChecked(sharedPrefs.getBoolean("CheckValue" + position, false));
              holder.cB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                  @Override
                  public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
  
  
                      editor.putBoolean("CheckValue" + position, isChecked);
                      editor.commit();
                  }});
              return convertView;
          }
  
          class ViewHolder {
              TextView txtName;
              CheckBox cB;
          }
          public List&lt;FilterModelClass&gt; getStudentist() {
              return searchArrayList;
          }
  
      }
  }
  </code></pre>