Refactor create and resume lifecycle for activities