i want have to fragment and in database i set a column for loginStatus by default its signout but when he sign in change to sign in and save in app the user sign in ... how can i do this with sharedpreferences to keep sign in user in application?
i want have to fragment and in database i set a column for loginStatus by default its signout but when he sign in change to sign in and save in app the user sign in ... how can i do this with sharedpreferences to keep sign in user in application?
You don't need to use sharedPreferences, you can update the column from signout to signin directly in you database.
use this code
SharedPreferences prefs;
prefs= PreferenceManager.getDefaultSharedPreferences(getActivity());
SharedPreferences.Editor editor = prefs.edit();
editor.putString("isSignIn", "Yes");
editor.commit();