i have a logout button that appear in all my activity class except login activity,.
the logout button have the same logic for all activity class, it simply tell the server the user is logged out, clear all of the shared preferences data, and bring the login activity to foreground
create an application subclass that have logout method, or an activity subclass that have logout method and all of my activity extends from this class..
which is better approach to achieve this? and what is cons and pros, if have any? thanks