DataHolder

public final class DataHolder

DataHolder is a singleton class that holds data as key-value pairs.

This is useful for passing data between activities and fragments.

Constructors

Link copied to clipboard

Types

Link copied to clipboard
public class Companion

Properties

Link copied to clipboard
public final static DataHolder.Companion Companion
Link copied to clipboard
private final Map<String, Object> extras

Map to hold the data

Functions

Link copied to clipboard
public final Unit clear()

Reset the DataHolder. Clear all the data.

Link copied to clipboard
public final Object getExtra(String name)

Get data from the DataHolder. Similar to getting an extra from an intent.

Link copied to clipboard
private final Map<String, Object> getExtras()

Map to hold the data

Link copied to clipboard
public final Unit putExtra(String name, Object obj)

Add data to the DataHolder. Similar to adding an extra to an intent.