Refreshing ListFragment data
<p>Im using supportApi for lower versions. I have a listFragment and an asynchAdapter which loads data in background from web. The problem is if the data is changed in Background I cant make the listFragment to refresh and show the new data. I have a customListAdapter that extend baseAdapter and I am calling setlistadapter(customListAdapter) in my ListFragment. I need some example which implements something like this not the cursorAdapter or simpleArrayAdapter.</p>

<p>The only problem I have is I dont know how to refresh the listFragment as onResume doesnt gets called and not sure if notifydatasetchange will work on listfragment. Some pieces of my code is as follow.</p>

<p>the onLoadFinish gets call only once when I initialize loader. The onresume gets called only once as well. May be my approach is wrong but that what I am not sure about.</p>

<pre><code>public class MyListFragment extends ListFragment implements LoaderManager.LoaderCallbacks&lt;ArrayList&lt;MyData&gt;&gt; {

    private ArrayList&lt;MyData&gt; mydata;
    private CustomListAdapter adapter;

    @Override public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        this.adapter = new CustomListAdapter(this.getActivity(), mydata);

        setListAdapter(this.adapter);
        getLoaderManager().initLoader(0, null, this);
    }

    @Override
    public void onLoadFinished(Loader&lt;ArrayList&lt;MyData&gt;&gt; Loader, ArrayList&lt;MyData&gt; mydata) {
        this.adapter.setData(mydata);
    }
}
</code></pre>
