Added Activity lifecycle methods in MainActivity