Kotlin extension functions for allowing Parcelable write and read from Android's shared preferences.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|// Being Location a Parcelable class, and location a valid initialized instance of this class:|
|// For writing|
|// For reading|
|val loadedLocation = sharedPreferences.getParcelable<Location?>("location", null)|
|// FOR LISTS|
|val loadedLocations = sharedPreferences.getParcelableList<Location>("location", listOf())|