prefs.getString("username", null) returns null when:
- No value has been saved for that key
- The value is longer than 10 characters
- The phone is offline
- The app is in landscape
Answer
A) No value has been saved for that key
The default value is returned if the key does not exist.
Computer Science MCQ · More Lab: SharedPreferences MCQs · Practise