What I want to do is, I guess at least, refresh a ListView when DialogFragment is being dismissed. Whole refresh process is in my AsyncTask. I found actually a lot questions/answers but nothing helpful in my case.
I tried:
1)onDismiss in my DialogFragment, get instance of AsyncTask local class and execute it. But I got bunch of errors and I think because I tryed to create a new Activity and each time dialog is dismissed, what actually makes no sense and futhermore eats memory a lot.
@Override
public void onDismiss(DialogInterface dialog) {
MainActivity outterObject = new MainActivity();
MainActivity.LoadApplications buffer = outterObject.new LoadApplications();
buffer.execute();
}
2)onResume in MainActivity, because I thought Activity goes into state 'paused' when Dialog appears. But it only refreshes ListView when I close and open my app again.
@Override
protected void onResume() {
super.onResume();
new LoadApplications().execute();
}