title: Refreshing a ListFragment with a LoaderManager
body: <p>I have a ListFragment class as a subclass of my activity and in my <code>PreferenceActivity</code> I have a setting to change the sorting of 2 out of the 5 possible list views I have but when I return back to the activity with the listviews the <code>onCreateLoader</code> does not get called again so the list remains the same.</p>
  
  <p>How can I update the list after changing the settings value?</p>
  
  <p>an example of my <code>onCreateLoader</code></p>
  
  <pre><code>if(pref.getString(Preferences.CAL_SORT, "1").equals("1")){
                  return new CursorLoader(getActivity(),CalendarEvents.EVENTS_URI,
                          new String[] {CalendarEvents.EVENT_ID,CalendarEvents.EVENT_READ,CalendarEvents.EVENT_SUBJECT,
                              CalendarEvents.EVENT_COMPANY_NAME,CalendarEvents.EVENT_START}
                          ,null,null,CalendarEvents.EVENT_COMPANY_NAME+" COLLATE LOCALIZED ASC," /*+ julianday("*/+CalendarEvents.EVENT_START/* + ")"*/ + " COLLATE LOCALIZED DESC");
              }else{
                  return new CursorLoader(getActivity(),CalendarEvents.EVENTS_URI,
                          new String[] {CalendarEvents.EVENT_ID,CalendarEvents.EVENT_READ,CalendarEvents.EVENT_SUBJECT,
                              CalendarEvents.EVENT_COMPANY_NAME,CalendarEvents.EVENT_START}
                          ,null,null,CalendarEvents.EVENT_COMPANY_NAME+" COLLATE LOCALIZED ASC," /*+ julianday("*/+CalendarEvents.EVENT_START/* + ")"*/ + " COLLATE LOCALIZED ASC");
              }
  </code></pre>
  
  <p>I know I can call <code>notifyDatasetChange()</code> on the adapter but the adapter is not visible to the outer activity. Should I do something in my <code>ContentProvider</code> </p>
  
  <p>This is how my class is structured</p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
  
      public static class ListViews extends ListFragment implements LoaderManager.LoaderCallbacks&lt;Cursor&gt;{
          public Loader&lt;Cursor&gt; onCreateLoader(int arg0,Bundle arg1){
          }
      }
  
      public void onResume(){
      }
  }
  </code></pre>