setting pin, shared preferences, activity lifecycles