title: having an issue with listView and adapter
body: <p>I'm having a problem with listview, when i click on items i get this error :</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification.</p>
  </blockquote>
  
  <p>I searched many days and i found this solution :</p>
  
  <pre><code>using notifyDataSetChanged();
  </code></pre>
  
  <p>but nothing happened.</p>
  
  <p>The important thing that i don't think that i'm changing the adapter from a backround thread, and this is my entire class :</p>
  
  <pre><code>public class requests extends DialogFragment implements AdapterView.OnItemClickListener {
  ListView listView;
  int id;
  Communicator communicator;
  ArrayList&lt;Integer&gt; intlist,picslist,phone,idlist;
  ArrayList&lt;String&gt; plat,plang,dlat,dlang,r,a;
  ArrayList&lt;String&gt; pickuplist,name;
  ArrayList&lt;String&gt; destinationlist;
  SwipeRefreshLayout refreshLayout;
  Dialog dialog;
  Adapter adapter;
  @Override
  public void onStart() {
  
      super.onStart();
      Dialog dialog = getDialog();
      if (dialog != null) {
          dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  
      }
  }
  
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) {
  
       dialog = super.onCreateDialog(savedInstanceState);
      dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
      return dialog;
  
  }
  @Override
  public void onAttach(Activity activity) {
  
      communicator= (Communicator) activity;
  
      super.onAttach(activity);
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState)
  
  {
  
  
      super.onCreate(savedInstanceState);
  }
  
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
  
      View view = inflater.inflate(R.layout.requests, null);
  
      picslist = new ArrayList&lt;&gt;();
      intlist = new ArrayList&lt;&gt;();
      pickuplist = new ArrayList&lt;&gt;();
      destinationlist = new ArrayList&lt;&gt;();
      phone = new ArrayList&lt;&gt;();
      idlist = new ArrayList&lt;&gt;();
      plat = new ArrayList&lt;&gt;();
      plang = new ArrayList&lt;&gt;();
      plat = new ArrayList&lt;&gt;();
      plang = new ArrayList&lt;&gt;();
      dlat = new ArrayList&lt;&gt;();
      dlang = new ArrayList&lt;&gt;();
      r = new ArrayList&lt;&gt;();
      a = new ArrayList&lt;&gt;();
  
  
  
  
      intlist = getArguments().getIntegerArrayList("images");
      pickuplist = getArguments().getStringArrayList("pickup");
      destinationlist = getArguments().getStringArrayList("destination");
      name = getArguments().getStringArrayList("name");
      phone = getArguments().getIntegerArrayList("phone");
      idlist = getArguments().getIntegerArrayList("ids");
      plat = getArguments().getStringArrayList("plat");
      plang = getArguments().getStringArrayList("plang");
      dlat = getArguments().getStringArrayList("dlat");
      dlang = getArguments().getStringArrayList("dlang");
      a = getArguments().getStringArrayList("dlang");
      r = getArguments().getStringArrayList("dlang");
      for (Integer inty : intlist) {
          switch (inty) {
              case 0:
                  picslist.add(R.drawable.man2);
                  break;
              case 1:
                  picslist.add(R.drawable.woman2);
                  break;
              case 2:
                  picslist.add(R.drawable.handicapped2);
                  break;
              case 3:
                  picslist.add(R.drawable.pregnant2);
                  break;
              default:
                  break;
  
  
          }
  
      }
      refreshLayout=(SwipeRefreshLayout)view.findViewById(R.id.swiperefresh);
              refreshLayout.setOnRefreshListener(
                      new SwipeRefreshLayout.OnRefreshListener() {
                          @Override
                          public void onRefresh() {
                                  communicator.refresh();
                                  dismiss();
  
                          }
                      }
              );
  
          listView = (ListView) view.findViewById(R.id.listView);
  
           adapter = new Adapter(getActivity(), pickuplist, destinationlist, picslist);
  
          listView.setAdapter(adapter);
  
  
          listView.setOnItemClickListener(this);
          return view;
  
  
      }
  
  
  
  
  
  @Override
  public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
  
  
      if (position &lt; name.size()&amp;&amp;position&lt;plat.size()&amp;&amp;position&lt;plang.size()&amp;&amp;position&lt;dlat.size()&amp;&amp;position&lt;dlang.size()&amp;&amp;position&lt;intlist.size()&amp;&amp;position&lt;idlist.size()&amp;&amp;position&lt;phone.size()){
  
          Intent intent = new Intent(getActivity(), client.class);
          intent.putExtra("name", name.get(position));
      intent.putExtra("phone", phone.get(position));
      intent.putExtra("plat", plat.get(position).toString());
      intent.putExtra("plang", plang.get(position).toString());
      intent.putExtra("dlat", dlat.get(position).toString());
      intent.putExtra("dlang", dlang.get(position).toString());
      intent.putExtra("extra", intlist.get(position));
      intent.putExtra("id", idlist.get(position));
      getActivity().startActivity(intent);
  
  
  }
  
  }
  
  class Adapter extends ArrayAdapter&lt;String&gt;{
      Context context;
  
      ArrayList&lt;Integer&gt; images=new ArrayList&lt;&gt;();
      ArrayList&lt;String&gt; pickup=new ArrayList&lt;&gt;();
      ArrayList&lt;String&gt; destination=new ArrayList&lt;&gt;();
      Adapter(Context c,ArrayList&lt;String&gt; pickup,ArrayList&lt;String&gt; destination, ArrayList&lt;Integer&gt; images) {
          super(c,R.layout.raw,R.id.textView,pickup);
          this.context=c;
          this.images=images;
          this.pickup=pickup;
          this.destination=destination;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View raw=convertView;
  
          if(raw==null) {
              LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              raw = inflater.inflate(R.layout.requestsraw, parent, false);
  
          }
  
          ImageView imageView= (ImageView) raw.findViewById(R.id.imageView22);
          TextView pickupp=(TextView) raw.findViewById(R.id.textView15);
          TextView destinationn=(TextView) raw.findViewById(R.id.textView16);
  
          if(position&lt;picslist.size()&amp;&amp;position&lt;pickuplist.size()&amp;&amp;position&lt;destinationlist.size()) {
              imageView.setImageResource(picslist.get(position));
              pickupp.setText(pickuplist.get(position));
              destinationn.setText(destinationlist.get(position));
          }
  
  
          return raw;
  
      }
  
  }
  
  
  }
  </code></pre>