Added a notification listener for when the app gets into an inactive state.