Removing preferences

To remove preferences, there is a remove method available, shown here:

    prefs.edit().remove("key").commit() 

Do not remove your preferences by overwriting them with empty data. For example, overwriting integers with null or strings with empty string.

Get Mastering Android Development with Kotlin now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.