Implemented proper android application life cycle