This code makes the login screen finish when the register is successful. It used to go back to login page when user presses back button in entrylogs screen. requestCode and requestResults are like switch that can pass in certain condition and this is a way for one activity to control other activity.