Added onpause method for second activity