How to get rid of this, I am using the Google compatibility library for Fragments. I have a the following error in log cat. Where MainMenuScreen is a FragmentActivity.
java.lang.IllegalStateException: Activity has been destroyed
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1314)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:541)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:525)
I am trying to call a method from a fragment which is in fragmentActivity, like the below
MainMenuScreen objMain= new MainMenuScreen();
if(SharedVariables.isTablet){
objMain.showFragment();}else{....}
And in MainMenuScreen the method is
public void showTrafficCasesDetails(){
detailsFragmentRoot.setVisibility(View.VISIBLE);
DetailsFrag detailsFrag=new DetailsFrag ();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.mainScreenDetailsFrame, detailsFrag);
transaction.commit();
}