Reputation: 184
hi i want to make different user menu when they login
first i created this code
String USER_TYPE_1 = "poeja";
then i make it like this code
if(tv_name.equals(pref.getString(USER_TYPE_1,""))){
tv_id.setText(pref.getString(Constants.UNIQUE_ID, ""));
}
in there i want to show UNIQUE_ID to user "poeja", but it gave me nothing and also no error in android stuido but the unique_id never show in there.
did i miss something? thanks
Upvotes: 0
Views: 42
Reputation: 749
Use this
if(tv_name.getText().toString().trim().equals(pref.getString(USER_TYPE_1,""))){
tv_id.setText(pref.getString(Constants.UNIQUE_ID, ""));
}
make sure your pref not returning null
Upvotes: 1