prefs.getString("username", null) returns null when:

  1. No value has been saved for that key
  2. The value is longer than 10 characters
  3. The phone is offline
  4. 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