I made a very simple Activity which shows a simple ListFragment like below:
My Activity:
public class MyActivity ex
super.onCreate(savedInstanceState) will call onCreate method in FragmentActivity, which will call mFragments.attachHost(null /*parent*/);
This sentence will assign a value to mHost in FragmentController, when you calls FragmentTransaction.commit() ,
In the method enqueueAction(),it has this sentences
if (mDestroyed || mHost == null) {
throw new IllegalStateException("Activity has been destroyed");
}
So if you haven't call super.onCreate(savedInstanceState) before you commit a fragmentTransaction, you will get this exception because mHost is null