title: Android: Custom Adapter not sorting list view
body: <p>I have one listview which adds correctly the Strings however after I sort the list cell and call notify, the adpater don't sort too. This seems reasonable since im not linking list cell and the adapter. So how to do that?</p>
  
  <pre><code>ListView listView = (ListView) findViewById(R.id.viewListViewUsuarios);
  List&lt;TextView&gt; listCell = new ArrayList&lt;TextView&gt;();
  
  //(get all TextView and put them on listCell)...
  
  private void reorderArray() {
  
          Collections.sort(listCell, new Comparator&lt;TextView&gt;() {
              @Override
              public int compare(TextView t1, TextView t2) {
                  return t1.getText().toString().compareToIgnoreCase(t2.getText().toString());
              }
          });
  
          CustomAdapter myCustomAdapter = new CustomAdapter();
          listView.setAdapter(myCustomAdapter);
  
      }
  }
  </code></pre>
  
  <p>And this is my Custom Adapter class</p>
  
  <pre><code>class CustomAdapter extends BaseAdapter {
  
      @Override
      public int getCount() {
          return listCell.size();
      }
  
      @Override
      public Object getItem(int i) {
          return null;
      }
  
      @Override
      public long getItemId(int i) {
          return 0;
      }
  
      @Override
      public void notifyDataSetChanged() {
          super.notifyDataSetChanged();
      }
  
      @Override
      public View getView(final int i, View view, ViewGroup viewGroup) {
          view = getLayoutInflater().inflate(R.layout.usuarios_aguardando_cell, null);
  
          TextView item = (TextView) view.findViewById(R.id.txtUsuariosAguardandoText);
          Button btnInv = (Button) view.findViewById(R.id.btnUsuariosAguardandoViewInvisible);
  
          TextView cell = listCell.get(i);
          item.setText(cell.getText());
          return view;
      }
  
  }
  </code></pre>
  
  <p>PS: Ive searched for other links similar to these but none were effective.</p>