title: ListView doesn't erase old text, only overlay the new
body: <p>I'm following the Sunshine tutorial on udacity, here comes my problem:</p>
  
  <p>I have a ListView with some items, taken from an ArrayAdapter: </p>
  
  <pre><code>List&lt;String&gt; weekForecast = new ArrayList&lt;String&gt;(Arrays.asList(data));
  mForecastAdapter =
                  new ArrayAdapter&lt;String&gt;(
                          getActivity(),
                          R.layout.list_item_forecast,
                          R.id.list_item_forecast_textview, 
                          weekForecast);
  listView.setAdapter(mForecastAdapter);
  </code></pre>
  
  <p>And in another function, as a background task, I update my Adapter:</p>
  
  <pre><code>if (result != null) {
     mForecastAdapter.clear();
     for(String dayForecastStr : result) {
        mForecastAdapter.add(dayForecastStr);
     }
     mForecastAdapter.notifyDataSetChanged();         
  }
  </code></pre>
  
  <p>But for some reason, I get these results:</p>
  
  <p><a href="https://i.stack.imgur.com/EzSA0m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EzSA0m.png" alt="before updating"></a>
  <a href="https://i.stack.imgur.com/ovfvlm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ovfvlm.png" alt="After updating"></a></p>
  
  <p>Anyone know a solution?</p>
  
  <hr>
  
  <p>UPDATE:
  weekForecast was a method variable, I declared it to be a class variable, now my update method is:</p>
  
  <pre><code>if (result != null) {
     weekForecast.clear();
     mForecastAdapter.clear();
     for(String dayForecastStr : result) {
        mForecastAdapter.add(dayForecastStr);
     }
     mForecastAdapter.notifyDataSetChanged();         
  }
  </code></pre>
  
  <h2>----------</h2>
  
  <p>UPDATE2:</p>
  
  <p>I got the solution, the problem was not caused by any procedure/variable in the class.
  That was a layout problem! I was using a <code>&lt;fragment&gt;</code> as main tag in layout.xml file instead of a <code>&lt;FrameLayout&gt;</code></p>