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

Removes all key-value pairs from the SavedState.

Cmn
android
Unit

Stores all key-value pairs from the provided SavedState into this SavedState.

Cmn
android
Unit
putBinder(key: String, value: IBinder)

Stores an IBinder value associated with the specified key in the IBinder.

android
Unit
putBoolean(key: String, value: Boolean)

Stores a boolean value associated with the specified key in the SavedState.

Cmn
android
Unit

Stores an Array of elements of Boolean associated with the specified key in the SavedState.

Cmn
android
Unit
putChar(key: String, value: Char)

Stores a char value associated with the specified key in the SavedState.

Cmn
android
Unit
putCharArray(key: String, value: CharArray)

Stores an Array of elements of Boolean associated with the specified key in the SavedState.

Cmn
android
Unit

Stores a char sequence value associated with the specified key in the SavedState.

Cmn
android
Unit

Stores an Array of elements of CharSequence associated with the specified key in the SavedState.

Cmn
android
Unit

Stores a list of elements of CharSequence associated with the specified key in the SavedState.

Cmn
android
Unit
putDouble(key: String, value: Double)

Stores a double value associated with the specified key in the SavedState.

Cmn
android
Unit

Stores an Array of elements of Double associated with the specified key in the SavedState.

Cmn
android
Unit
putFloat(key: String, value: Float)

Stores a float value associated with the specified key in the SavedState.

Cmn
android
Unit

Stores an Array of elements of Float associated with the specified key in the SavedState.

Cmn
android
Unit
putInt(key: String, value: Int)

Stores an int value associated with the specified key in the SavedState.

Cmn
android
Unit
putIntArray(key: String, value: IntArray)

Stores an Array of elements of Int associated with the specified key in the SavedState.

Cmn
android
Unit
putIntList(key: String, value: List<Int>)

Stores a list of elements of Int associated with the specified key in the SavedState.

Cmn
android
Unit
<T : Serializable> putJavaSerializable(key: String, value: T)

Stores an Serializable value associated with the specified key in the Serializable.

android
Unit
putLong(key: String, value: Long)

Stores an int value associated with the specified key in the SavedState.

Cmn
android
Unit
putLongArray(key: String, value: LongArray)

Stores an Array of elements of Long associated with the specified key in the SavedState.

Cmn
android
Unit

Stores a null reference associated with the specified key in the SavedState.

Cmn
android
Unit
<T : Parcelable> putParcelable(key: String, value: T)

Stores an Parcelable value associated with the specified key in the SavedState.

android
Unit
<T : Parcelable> putParcelableArray(key: String, value: Array<T>)

Stores a Array of elements of Parcelable associated with the specified key in the SavedState.

android
Unit
<T : Parcelable> putParcelableList(key: String, value: List<T>)

Stores a List of elements of Parcelable associated with the specified key in the SavedState.

android
Unit

Stores a SavedState object associated with the specified key in the SavedState.

Cmn
android
Unit

Stores an Array of elements of SavedState associated with the specified key in the SavedState.

Cmn
android
Unit

Stores a list of elements of SavedState associated with the specified key in the SavedState.

Cmn
android
Unit
putSize(key: String, value: Size)

Stores an Size value associated with the specified key in the Size.

android
Unit
putSizeF(key: String, value: SizeF)

Stores an SizeF value associated with the specified key in the SizeF.

android
Unit

Stores a SparseArray of elements of Parcelable associated with the specified key in the SavedState.

android
Unit
putString(key: String, value: String)

Stores a string value associated with the specified key in the SavedState.

Cmn
android
Unit
putStringArray(key: String, value: Array<String>)

Stores an Array of elements of String associated with the specified key in the SavedState.

Cmn
android
Unit
putStringList(key: String, value: List<String>)

Stores a list of elements of String associated with the specified key in the SavedState.

Cmn
android
Unit
remove(key: String)

Removes the value associated with the specified key from the SavedState.

Cmn
android

Public functions

clear

fun clear(): Unit

Removes all key-value pairs from the SavedState.

putAll

fun putAll(from: SavedState): Unit

Stores all key-value pairs from the provided SavedState into this SavedState.

Parameters
from: SavedState

The SavedState containing the key-value pairs to add.

putBinder

fun putBinder(key: String, value: IBinder): Unit

Stores an IBinder value associated with the specified key in the IBinder.

Parameters
key: String

The key to associate the value with.

value: IBinder

The IBinder value to store.

putBoolean

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

Stores a boolean value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Boolean

The boolean value to store.

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.

Parameters
key: String

The key to associate the value with.

value: Char

The char value to store.

putCharArray

fun putCharArray(key: String, value: CharArray): 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: CharArray

The array of elements to store.

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.

Parameters
key: String

The key to associate the value with.

value: Double

The double value to store.

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.

Parameters
key: String

The key to associate the value with.

value: Float

The float value to store.

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.

Parameters
key: String

The key to associate the value with.

value: Int

The int value to store.

putIntArray

fun putIntArray(key: String, value: IntArray): Unit

Stores an Array of elements of Int associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: IntArray

The array of elements to store.

putIntList

fun putIntList(key: String, value: List<Int>): Unit

Stores a list of elements of Int associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: List<Int>

The list of elements to store.

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 Serializable value to store.

putLong

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

Stores an int value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Long

The Long value to store.

putLongArray

fun putLongArray(key: String, value: LongArray): Unit

Stores an Array of elements of Long associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: LongArray

The array of elements to store.

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 Parcelable value to store.

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.

Parameters
key: String

The key to associate the value with.

value: Array<T>

The Array of elements to store.

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.

Parameters
key: String

The key to associate the value with.

value: List<T>

The List of elements to store.

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 SavedState object to store

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.

Parameters
key: String

The key to associate the value with.

value: Size

The Size value to store.

putSizeF

fun putSizeF(key: String, value: SizeF): Unit

Stores an SizeF value associated with the specified key in the SizeF.

Parameters
key: String

The key to associate the value with.

value: SizeF

The SizeF value to store.

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 SparseArray of elements to store.

putString

fun putString(key: String, value: String): Unit

Stores a string value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: String

The string value to store.

putStringArray

fun putStringArray(key: String, value: Array<String>): Unit

Stores an Array of elements of String associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Array<String>

The array of elements to store.

putStringList

fun putStringList(key: String, value: List<String>): Unit

Stores a list of elements of String associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: List<String>

The list of elements to store.

remove

fun remove(key: String): Unit

Removes the value associated with the specified key from the SavedState.

Parameters
key: String

The key to remove.