Skip to content Skip to sidebar Skip to footer

Condition Is Not Working In Sharedpreferences Android

I have a Login page, so for that I am using SharedPreferences. I am trying to save values. Without values, it shouldn't go to the another Activity for that I have given this in Log

Solution 1:

You need to try with contains(String Key)

Try this spv.contains("uname") instead of (spv !=null) or spv.equals("") I also Faced this issue Better To use Hashmap... but this works for your Case..

Post a Comment for "Condition Is Not Working In Sharedpreferences Android"