title: How to use notifyDataSetChanged() after updating a row
body: <p>I have a custom adapter as following (declared global e)</p>
  
  <pre><code>CustomAdapter adapterE;
  </code></pre>
  
  <p>I am making a database call for updating a row in the db in the <code>onItemClick</code> listener of the <code>listView</code> <code>listItem</code>. the db row is updating properly</p>
  
  <p>after that i am getting the <code>List&lt;TVShow&gt;</code> with the updated result and calling the <code>notifyDataSetChanged()</code> so that the <code>listView</code> refresh </p>
  
  <p>But its not refreshing in the view. if i press back and go back and then come again to this <code>ActivityTVShowEpisode</code> activity then i see the result. as my understanding notifyDataSetChanged() should do that on the fly.</p>
  
  <p>So, What is the problem?</p>
  
  <p>Please see my code below </p>
  
  <pre><code>public class ActivityTVShowEpisode extends Activity{ 
  
  private Context context; 
  TVShowService tvService; 
  List&lt;TVShow&gt; listOfShows=null; 
  TvShowEpisodAdapter adapterE; 
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) { 
      context = ActivityTVShowEpisode.this.getApplicationContext(); 
  
      //getting episode of selected TV Show and Season 
      tvService = new TVShowService(); 
  
      try { 
          listOfShows = tvService.getEpisodeOfASeason(context, tvShowName,tvShowSeasonName); 
      } catch (SQLException e) { 
          // TODO Auto-generated catch block 
          e.printStackTrace(); 
      } 
  
  
      final ListView listview = (ListView) findViewById(R.id.listViewTvEpisod); 
      adapterE = new TvShowEpisodAdapter(this, R.layout.list_row_episod, listOfShows); 
      listview.setAdapter(adapterE); 
  
      listview.setOnItemClickListener(new AdapterView.OnItemClickListener() { 
          @Override
          public void onItemClick(AdapterView&lt;?&gt; adapter, View view, int position, long id) { 
  
              try { 
                  status = tvService.updateOneEpisode(context, tvShowName,tvShowSeasonName,txtEpisodeName.getText().toString()); 
              } catch (SQLException e) { 
                  e.printStackTrace(); 
              } 
  
  
  
  
              try { 
                  listOfShows = tvService.getEpisodeOfASeason(context, tvShowName,tvShowSeasonName); 
              } catch (SQLException e) { 
                  // TODO Auto-generated catch block 
                  e.printStackTrace(); 
              } 
  
  
              //I have tried with and without the following one line
              adapterE = new TvShowEpisodAdapter(ActivityTVShowEpisode .this, R.layout.list_row_episod, listOfShows); 
  
              adapterE.notifyDataSetChanged(); 
          } 
      }); 
  
  } 
  </code></pre>
  
  <p>} </p>