What I am attempting is to wait in my main activity until my fragment finishes, so I can execute code without causing problems in the fragment. I have tried many methods and can't get a solution. Heres some of my code from my main activity:
if (null == savedInstanceState) {
getFragmentManager().beginTransaction()
.replace(R.id.container, CameraFragment.newInstance())
.commit();
}
This will run a fragment that takes a picture and saves it.
The problem i'm having is, for example, I want to wait until this fragment has finished, then execute more code from my main activity. I can't find a working solution.
Edit: Solved, see the answer. Thanks!