call of onStart and onStop moved to the main thread to be consistent with android apps