I Found a solution, the solution was to move all the app code from the fragment to MainAcitivity and create a wake-up method at the end of MainAcitivity void waky(){ // wake up code } then on completion of the app code call the wake-up method: void waky();