I have a fragment activity containing a fragment, The fragment starts Asynctask, which loads some data, I applied a callback method in my fragment, which updates some values โโin the adapter and the list. I have the following problem: This is my onCreateView method (important part):
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { list=(PullToRefreshListView)v1.findViewById(R.id.listapull); adapterList=new ListViewAdapter(secciones, mContext); }
when I rotate the device while AsyncTask is running, the doInBackground () method continues to work, and then after starting it, it starts the listener and runs the callback method in my fragment, this method has old links of my adapter and my View list: 
The fragment and its contents are recreated when the orientation changes and this is correct, but does anyone know why the callback method saves the link to the adapter and the list created before the orientation change?
EDIT:
I have a button that executes asynctask as follows:
asyncRefresh = new PullRefreshTask(taskContext, mContext, secciones); asyncRefresh.setUpdatePull2RefreshListener(this); asyncRefresh.execute();
If the user clicks the button, asyncTask will set the old fragment as a listener, and when the orientation changes during the synthesis, I thought that the activated callback method was the only one from the method of the newly created fragment, but I'm not finite.
EDIT 2:
I solved my problem since I said in my first edit that the callback method is being called for the old fragment. so I did to save my async in a variable in another class called "Information", and in the "Create View" mode I did this:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { list=(PullToRefreshListView)v1.findViewById(R.id.listapull); adapterList=new ListViewAdapter(secciones, mContext); PullRefreshTasktask task = Info.getAsyncTask(); asyncRefresh = task; asyncRefresh.setUpdatePull2RefreshListener(this); }
So I set a new link to my fragment in
setUpdatePull2RefreshListener ()
running synthetics method