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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.