In this example creating login page fuctionality and save user data as like in session. After loging user will redirect to login screen and after back button click do not show login page. Using shared preferences to save and get user data globally through out the application There are two ways to save data globally.: 1. Save data in global variables : If we are storing data in global variable , data will be lost once user closes the application.