Skip to content

//sorisdk/com.iplateia.sorisdk/setPreference

setPreference

[androidJvm]
fun setPreference(context: Context, key: String, value: String)

Save a string preference in shared preferences.

Parameters

androidJvm

contextThe context from which to access shared preferences
keyThe key for the preference
valueThe value to set

[androidJvm]
fun setPreference(context: Context, key: String, value: Objects)

Save an object preference in shared preferences. The value should be serializable using Kotlin serialization.

Parameters

androidJvm

contextThe context from which to access shared preferences
keyThe key for the preference