Connected the login activity with the main activity, and added the relevant code to the fragments.