SavedStateWriter
-
Cmn
value class SavedStateWriter
An inline class that encapsulates an opaque SavedState, and provides an API for writing the platform specific state.
| See also | |
|---|---|
write |
Summary
Public functions |
||
|---|---|---|
Unit |
clear()Removes all key-value pairs from the |
Cmn
android
|
Unit |
android
|
|
Unit |
putAll(from: SavedState)Stores all key-value pairs from the provided |
Cmn
android
|
Unit |
Stores an |
android
|
Unit |
putBoolean(key: String, value: Boolean)Stores a boolean value associated with the specified key in the |
Cmn
android
|
Unit |
putBooleanArray(key: String, value: BooleanArray)Stores an |
Cmn
android
|
Unit |
Stores a char value associated with the specified key in the |
Cmn
android
|
Unit |
putCharArray(key: String, value: CharArray)Stores an |
Cmn
android
|
Unit |
putCharSequence(key: String, value: CharSequence)Stores a char sequence value associated with the specified key in the |
Cmn
android
|
Unit |
putCharSequenceArray(key: String, value: Array<CharSequence>)Stores an |
Cmn
android
|
Unit |
putCharSequenceList(key: String, value: List<CharSequence>)Stores a list of elements of |
Cmn
android
|
Unit |
Stores a double value associated with the specified key in the |
Cmn
android
|
Unit |
putDoubleArray(key: String, value: DoubleArray)Stores an |
Cmn
android
|
Unit |
Stores a float value associated with the specified key in the |
Cmn
android
|
Unit |
putFloatArray(key: String, value: FloatArray)Stores an |
Cmn
android
|
Unit |
Stores an int value associated with the specified key in the |
Cmn
android
|
Unit |
putIntArray(key: String, value: IntArray)Stores an |
Cmn
android
|
Unit |
putIntList(key: String, value: List<Int>)Stores a list of elements of |
Cmn
android
|
Unit |
<T : Serializable> putJavaSerializable(key: String, value: T)Stores an |
android
|
Unit |
Stores an int value associated with the specified key in the |
Cmn
android
|
Unit |
putLongArray(key: String, value: LongArray)Stores an |
Cmn
android
|
Unit |
Stores a null reference associated with the specified key in the |
Cmn
android
|
Unit |
<T : Parcelable> putParcelable(key: String, value: T)Stores an |
android
|
Unit |
<T : Parcelable> putParcelableArray(key: String, value: Array<T>)Stores a |
android
|
Unit |
<T : Parcelable> putParcelableList(key: String, value: List<T>)Stores a |
android
|
Unit |
putSavedState(key: String, value: Bundle) |
android
|
Unit |
putSavedState(key: String, value: SavedState)Stores a |
Cmn
android
|
Unit |
putSavedStateArray(key: String, value: Array<Bundle>) |
android
|
Unit |
putSavedStateArray(key: String, value: Array<SavedState>)Stores an |
Cmn
android
|
Unit |
putSavedStateList(key: String, value: List<Bundle>) |
android
|
Unit |
putSavedStateList(key: String, value: List<SavedState>)Stores a list of elements of |
Cmn
android
|
Unit |
Stores an |
android
|
Unit |
Stores an |
android
|
Unit |
<T : Parcelable> putSparseParcelableArray(key: String, value: SparseArray<T>)Stores a |
android
|
Unit |
Stores a string value associated with the specified key in the |
Cmn
android
|
Unit |
putStringArray(key: String, value: Array<String>)Stores an |
Cmn
android
|
Unit |
putStringList(key: String, value: List<String>)Stores a list of elements of |
Cmn
android
|
Unit |
Removes the value associated with the specified key from the |
Cmn
android
|
Public functions
putAll
fun putAll(from: SavedState): Unit
Stores all key-value pairs from the provided SavedState into this SavedState.
| Parameters | |
|---|---|
from: SavedState |
The |
putBinder
fun putBinder(key: String, value: IBinder): Unit
Stores an IBinder value associated with the specified key in the IBinder.
putBoolean
fun putBoolean(key: String, value: Boolean): Unit
Stores a boolean value associated with the specified key in the SavedState.
putBooleanArray
fun putBooleanArray(key: String, value: BooleanArray): Unit
Stores an Array of elements of Boolean associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: BooleanArray |
The array of elements to store. |
putChar
fun putChar(key: String, value: Char): Unit
Stores a char value associated with the specified key in the SavedState.
putCharArray
fun putCharArray(key: String, value: CharArray): Unit
Stores an Array of elements of Boolean associated with the specified key in the SavedState.
putCharSequence
fun putCharSequence(key: String, value: CharSequence): Unit
Stores a char sequence value associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: CharSequence |
The char sequence value to store. |
putCharSequenceArray
fun putCharSequenceArray(key: String, value: Array<CharSequence>): Unit
Stores an Array of elements of CharSequence associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: Array<CharSequence> |
The array of elements to store. |
putCharSequenceList
fun putCharSequenceList(key: String, value: List<CharSequence>): Unit
Stores a list of elements of CharSequence associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: List<CharSequence> |
The list of elements to store. |
putDouble
fun putDouble(key: String, value: Double): Unit
Stores a double value associated with the specified key in the SavedState.
putDoubleArray
fun putDoubleArray(key: String, value: DoubleArray): Unit
Stores an Array of elements of Double associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: DoubleArray |
The array of elements to store. |
putFloat
fun putFloat(key: String, value: Float): Unit
Stores a float value associated with the specified key in the SavedState.
putFloatArray
fun putFloatArray(key: String, value: FloatArray): Unit
Stores an Array of elements of Float associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: FloatArray |
The array of elements to store. |
putInt
fun putInt(key: String, value: Int): Unit
Stores an int value associated with the specified key in the SavedState.
putIntArray
fun putIntArray(key: String, value: IntArray): Unit
Stores an Array of elements of Int associated with the specified key in the SavedState.
putIntList
fun putIntList(key: String, value: List<Int>): Unit
Stores a list of elements of Int associated with the specified key in the SavedState.
putJavaSerializable
fun <T : Serializable> putJavaSerializable(key: String, value: T): Unit
Stores an Serializable value associated with the specified key in the Serializable.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: T |
The |
putLong
fun putLong(key: String, value: Long): Unit
Stores an int value associated with the specified key in the SavedState.
putLongArray
fun putLongArray(key: String, value: LongArray): Unit
Stores an Array of elements of Long associated with the specified key in the SavedState.
putNull
fun putNull(key: String): Unit
Stores a null reference associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the null reference. |
putParcelable
fun <T : Parcelable> putParcelable(key: String, value: T): Unit
Stores an Parcelable value associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: T |
The |
putParcelableArray
fun <T : Parcelable> putParcelableArray(key: String, value: Array<T>): Unit
Stores a Array of elements of Parcelable associated with the specified key in the SavedState.
putParcelableList
fun <T : Parcelable> putParcelableList(key: String, value: List<T>): Unit
Stores a List of elements of Parcelable associated with the specified key in the SavedState.
putSavedState
fun putSavedState(key: String, value: SavedState): Unit
Stores a SavedState object associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: SavedState |
The |
putSavedStateArray
fun putSavedStateArray(key: String, value: Array<SavedState>): Unit
Stores an Array of elements of SavedState associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: Array<SavedState> |
The array of elements to store. |
putSavedStateList
fun putSavedStateList(key: String, value: List<SavedState>): Unit
Stores a list of elements of SavedState associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: List<SavedState> |
The list of elements to store. |
putSize
fun putSize(key: String, value: Size): Unit
Stores an Size value associated with the specified key in the Size.
putSizeF
fun putSizeF(key: String, value: SizeF): Unit
Stores an SizeF value associated with the specified key in the SizeF.
putSparseParcelableArray
fun <T : Parcelable> putSparseParcelableArray(key: String, value: SparseArray<T>): Unit
Stores a SparseArray of elements of Parcelable associated with the specified key in the SavedState.
| Parameters | |
|---|---|
key: String |
The key to associate the value with. |
value: SparseArray<T> |
The |
putString
fun putString(key: String, value: String): Unit
Stores a string value associated with the specified key in the SavedState.
putStringArray
fun putStringArray(key: String, value: Array<String>): Unit
Stores an Array of elements of String associated with the specified key in the SavedState.
putStringList
fun putStringList(key: String, value: List<String>): Unit
Stores a list of elements of String associated with the specified key in the SavedState.
remove
fun remove(key: String): Unit
Removes the value associated with the specified key from the SavedState.
| Parameters | |
|---|---|
key: String |
The key to remove. |