Added onPaude and onResume methods so we can test life cycle.