title: ListView text changing but not adapter data
body: <p>I added 3 items to my <code>ListView</code>. Each item says "Test". When I click on an item, I clear that item's text. However, when I check the variable in the "watches" log, the item is still named "Test" even though I removed the text.</p>
  
  <p>watches log:</p>
  
  <pre><code>adapter2.getItem(1) = {java.lang.String@830045070536}"Test"
  list.getItemAtPosition(1) = {java.lang.String@830045070536}"Test"
  </code></pre>
  
  <p>I want the <code>ListView</code> to get updated and make the item blank after being clicked</p>
  
  <p>for example the watches log should look like this:</p>
  
  <pre><code>adapter2.getItem(1) = {java.lang.String@830045070536}""
  list.getItemAtPosition(1) = {java.lang.String@830045070536}""
  </code></pre>
  
  <p>Can some one please tell me why my this is happening and offer a solution?</p>
  
  <p><strong>Edited Code</strong></p>
  
  <pre><code>public class ListView2 extends Fragment {
  
      ListView list;
      ArrayAdapter&lt;String&gt; adapter2;
      List&lt;String&gt; array_list;
  
      @Override
      public View onCreateView(LayoutInflater inflater,
                               @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          return inflater.inflate(R.layout.listview2, container, false);
  
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
  
          array_list = new ArrayList&lt;String&gt;();
  
          array_list.add("Test");
          array_list.add("Test");
          array_list.add("Test");
  
          //Build Adapter
          adapter2 = new ArrayAdapter&lt;String&gt;(getActivity(), R.layout.items, array_list);
  
          //Configure the list view
          list = (ListView) getActivity().findViewById(R.id.listview2);
          list.setAdapter(adapter2);
  
          list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                      int position, long id) {
  
                  TextView txt = (TextView)view.findViewById(R.id.txt);
                  if(txt.getText().toString().equals("Test")) {
                      txt.setText("");
                  }else{
                      txt.setText("Test");
                  }
                  adapter2.notifyDataSetChanged();
              }
          });
  
      }
  }
  </code></pre>