String format of sharedPreferences
I am trying to modify the following code:
dictName = sharedPreferences.getString(PREFERENCES_DICT_NAME, null);
if (dictName == null) {
}
My situation is I know dictName is not null and its value is "something".
So I modified the code into:
dictName = sharedPreferences.getString(PREFERENCES_DICT_NAME, null);
if (dictName == "something") {
}
However, I can't get my code work. So I am wondering is it correct for me
to put dictName =="something"?
No comments:
Post a Comment