# PreferenceDataStore

# PreferenceDataStore

Artifact:[androidx.preference:preference](https://developer.android.com/jetpack/androidx/releases/preference)  
[View Source](https://cs.android.com/search?q=file:androidx/preference/PreferenceDataStore.java+class:androidx.preference.PreferenceDataStore)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/preference/PreferenceDataStore "View this page in Java")

<br />

```
abstract class PreferenceDataStore
```

<br />

*** ** * ** ***

A data store interface to be implemented and provided to the[Preference](https://developer.android.com/reference/kotlin/androidx/preference/Preference)framework. This can be used to replace the default[android.content.SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences.html), if needed.

In most cases you want to use[android.content.SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences.html)as it is automatically backed up and migrated to new devices. However, providing custom data store to preferences can be useful if your app stores its preferences in a local database, cloud, or they are device specific like "Developer settings". It might be also useful when you want to use the preferences UI but the data is not supposed to be stored at all because they are only valid per session.

Once a put method is called it is the full responsibility of the data store implementation to safely store the given values. Time expensive operations need to be done in the background to prevent from blocking the UI. You also need to have a plan on how to serialize the data in case the activity holding this object gets destroyed.

By default, all "put" methods throw[UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException.html).  

|                                                                                    See also                                                                                    |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setPreferenceDataStore](https://developer.android.com/reference/kotlin/androidx/preference/Preference#setPreferenceDataStore(androidx.preference.PreferenceDataStore))        |   |
| [setPreferenceDataStore](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceManager#setPreferenceDataStore(androidx.preference.PreferenceDataStore)) |   |

## Summary

|                                                         ### Public constructors                                                         |
|-----------------------------------------------------------------------------------------------------------------------------------------|
| [PreferenceDataStore](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#PreferenceDataStore())`()` |

|                                                                                                                                   ### Public functions                                                                                                                                    |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                       | [getBoolean](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getBoolean(java.lang.String,boolean))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, defValue: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Retrieves a[Boolean](https://developer.android.com/reference/java/lang/Boolean.html)value from the data store.                                                                                                                                                                                                                       |
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                                                                                                                                                                                                           | [getFloat](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getFloat(java.lang.String,float))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, defValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Retrieves a[Float](https://developer.android.com/reference/java/lang/Float.html)value from the data store.                                                                                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                                                               | [getInt](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getInt(java.lang.String,int))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, defValue: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Retrieves an[Integer](https://developer.android.com/reference/java/lang/Integer.html)value from the data store.                                                                                                                                                                                                                                          |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                                                                                                                             | [getLong](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getLong(java.lang.String,long))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, defValue: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Retrieves a[Long](https://developer.android.com/reference/java/lang/Long.html)value from the data store.                                                                                                                                                                                                                                            |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                                      | [getString](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getString(java.lang.String,java.lang.String))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, defValue: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` Retrieves a[String](https://developer.android.com/reference/java/lang/String.html)value from the data store.                                                                                                                                                                                                                   |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)`)`[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>?` | [getStringSet](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getStringSet(java.lang.String,java.util.Set<java.lang.String>))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, defValues: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)`)`[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>?)` Retrieves a set of Strings from the data store.                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                             | [putBoolean](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putBoolean(java.lang.String,boolean))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, value: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets a[Boolean](https://developer.android.com/reference/java/lang/Boolean.html)value to the data store.                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                             | [putFloat](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putFloat(java.lang.String,float))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets a[Float](https://developer.android.com/reference/java/lang/Float.html)value to the data store.                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                             | [putInt](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putInt(java.lang.String,int))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, value: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets an[Integer](https://developer.android.com/reference/java/lang/Integer.html)value to the data store.                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                             | [putLong](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putLong(java.lang.String,long))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, value: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Sets a[Long](https://developer.android.com/reference/java/lang/Long.html)value to the data store.                                                                                                                                                                                                                                                      |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                             | [putString](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putString(java.lang.String,java.lang.String))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, value: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` Sets a[String](https://developer.android.com/reference/java/lang/String.html)value to the data store.                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                             | [putStringSet](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putStringSet(java.lang.String,java.util.Set<java.lang.String>))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, values: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)`)`[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>?)` Sets a set of[String](https://developer.android.com/reference/java/lang/String.html)s to the data store. |

## Public constructors

### PreferenceDataStore

Added in 1.0.0  

```
PreferenceDataStore()
```  

## Public functions

### getBoolean

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun getBoolean(key: String!, defValue: Boolean): Boolean
```

Retrieves a[Boolean](https://developer.android.com/reference/java/lang/Boolean.html)value from the data store.  

|                                           Parameters                                            |
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`     | The name of the preference to retrieve                           |
| `defValue: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Value to return if this preference does not exist in the storage |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | the value from the data store or the default return value |

|                                                                 See also                                                                  |
|-------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getBoolean](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getBoolean(java.lang.String,boolean)) |   |

### getFloat

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun getFloat(key: String!, defValue: Float): Float
```

Retrieves a[Float](https://developer.android.com/reference/java/lang/Float.html)value from the data store.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the preference to retrieve                           |
| `defValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | Value to return if this preference does not exist in the storage |

|                                     Returns                                     |
|---------------------------------------------------------------------------------|-----------------------------------------------------------|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The value from the data store or the default return value |

|                                                              See also                                                               |
|-------------------------------------------------------------------------------------------------------------------------------------|---|
| [putFloat](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putFloat(java.lang.String,float)) |   |

### getInt

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun getInt(key: String!, defValue: Int): Int
```

Retrieves an[Integer](https://developer.android.com/reference/java/lang/Integer.html)value from the data store.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the preference to retrieve                           |
| `defValue: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | Value to return if this preference does not exist in the storage |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The value from the data store or the default return value |

|                                                           See also                                                            |
|-------------------------------------------------------------------------------------------------------------------------------|---|
| [putInt](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putInt(java.lang.String,int)) |   |

### getLong

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun getLong(key: String!, defValue: Long): Long
```

Retrieves a[Long](https://developer.android.com/reference/java/lang/Long.html)value from the data store.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the preference to retrieve                           |
| `defValue: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)   | Value to return if this preference does not exist in the storage |

|                                    Returns                                    |
|-------------------------------------------------------------------------------|-----------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The value from the data store or the default return value |

|                                                             See also                                                             |
|----------------------------------------------------------------------------------------------------------------------------------|---|
| [putLong](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putLong(java.lang.String,long)) |   |

### getString

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun getString(key: String!, defValue: String?): String?
```

Retrieves a[String](https://developer.android.com/reference/java/lang/String.html)value from the data store.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`      | The name of the preference to retrieve                           |
| `defValue: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | Value to return if this preference does not exist in the storage |

|                                       Returns                                        |
|--------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | The value from the data store or the default return value |

|                                                                     See also                                                                     |
|--------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [putString](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putString(java.lang.String,java.lang.String)) |   |

### getStringSet

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun getStringSet(key: String!, defValues: (Mutable)Set<String!>?): (Mutable)Set<String!>?
```

Retrieves a set of Strings from the data store.  

|                                                                                                                                              Parameters                                                                                                                                              |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                                                                                                                                          | The name of the preference to retrieve                            |
| `defValues: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)`)`[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>?` | Values to return if this preference does not exist in the storage |

|                                                                                                                                          Returns                                                                                                                                          |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)`)`[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>?` | The values from the data store or the default return values |

|                                                                               See also                                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [putStringSet](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#putStringSet(java.lang.String,java.util.Set<java.lang.String>)) |   |

### putBoolean

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun putBoolean(key: String!, value: Boolean): Unit
```

Sets a[Boolean](https://developer.android.com/reference/java/lang/Boolean.html)value to the data store.

Once the value is set the data store is responsible for holding it.  

|                                          Parameters                                          |
|----------------------------------------------------------------------------------------------|--------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`  | The name of the preference to modify |
| `value: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | The new value for the preference     |

|                                                                 See also                                                                  |
|-------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getBoolean](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getBoolean(java.lang.String,boolean)) |   |

### putFloat

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun putFloat(key: String!, value: Float): Unit
```

Sets a[Float](https://developer.android.com/reference/java/lang/Float.html)value to the data store.

Once the value is set the data store is responsible for holding it.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|--------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the preference to modify |
| `value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)    | The new value for the preference     |

|                                                              See also                                                               |
|-------------------------------------------------------------------------------------------------------------------------------------|---|
| [getFloat](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getFloat(java.lang.String,float)) |   |

### putInt

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun putInt(key: String!, value: Int): Unit
```

Sets an[Integer](https://developer.android.com/reference/java/lang/Integer.html)value to the data store.

Once the value is set the data store is responsible for holding it.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|--------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the preference to modify |
| `value: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)        | The new value for the preference     |

|                                                           See also                                                            |
|-------------------------------------------------------------------------------------------------------------------------------|---|
| [getInt](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getInt(java.lang.String,int)) |   |

### putLong

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun putLong(key: String!, value: Long): Unit
```

Sets a[Long](https://developer.android.com/reference/java/lang/Long.html)value to the data store.

Once the value is set the data store is responsible for holding it.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|--------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the preference to modify |
| `value: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)      | The new value for the preference     |

|                                                             See also                                                             |
|----------------------------------------------------------------------------------------------------------------------------------|---|
| [getLong](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getLong(java.lang.String,long)) |   |

### putString

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun putString(key: String!, value: String?): Unit
```

Sets a[String](https://developer.android.com/reference/java/lang/String.html)value to the data store.

Once the value is set the data store is responsible for holding it.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|--------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`   | The name of the preference to modify |
| `value: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | The new value for the preference     |

|                                                                     See also                                                                     |
|--------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getString](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getString(java.lang.String,java.lang.String)) |   |

### putStringSet

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0)  

```
fun putStringSet(key: String!, values: (Mutable)Set<String!>?): Unit
```

Sets a set of[String](https://developer.android.com/reference/java/lang/String.html)s to the data store.

Once the value is set the data store is responsible for holding it.  

|                                                                                                                                            Parameters                                                                                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| `key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                                                                                                                                       | The name of the preference to modify     |
| `values: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)`)`[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>?` | The set of new values for the preference |

|                                                                               See also                                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getStringSet](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDataStore#getStringSet(java.lang.String,java.util.Set<java.lang.String>)) |   |