-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added Utils class #169
Conversation
editor.putString(Constant.CITY, ""); | ||
editor.putString(Constant.STATE, ""); | ||
editor.putString(Constant.ACHIEVEMENTS, ""); | ||
editor.apply(); | ||
Toast.makeText(this, "Logged Out", Toast.LENGTH_LONG).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this also in utils file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atm1504 i don't think it's a good idea, since we can reset values for other purposes also(excluding logout)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The moment u call this, u r actually logging out first, then resetting the values. So, it would be a good habit to inform the user that he has been logged out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before logout an alert dialog pops up.....After logout Toast is displayed...
@@ -318,29 +319,10 @@ private void setHeaderData() { | |||
|
|||
private void clearData() { | |||
editor = preferences.edit(); | |||
//method to reset shared preferences | |||
Utils.resetSharedPreferences(preferences, editor); | |||
if (preferences.getBoolean(Constant.LOGIN_STATUS, false)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Fixes #164
Changes: I have added a utility class
It has two methods:
one to close keyboard.
Second to reset Shared Preferences.