commit fragment from onLoadFinished within activity
I have an activity which loads a data list from the server using loader callbacks. I have to list out the data into a fragment which extends SherlockListFragment i tried to commit the fragment using Fragment newFragment = CategoryFragment.newInstance(mStackLevel,categoryList); FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.add(R.id.simple_fragment, newFragment).commit(); in onLoadFinished and it gives an IllegalStateException saying java.lang.IllegalStateException: Can not perform this action inside of onLoadFinished I have referred the example in actionbar