BaseBundle
public
class
BaseBundle
extends Object
java.lang.Object | |
↳ | android.os.BaseBundle |
A mapping from String keys to values of various types. In most cases, you
should work directly with either the Bundle
or
PersistableBundle
subclass.
Summary
Public methods | |
---|---|
void
|
clear()
Removes all elements from the mapping of this Bundle. |
boolean
|
containsKey(String key)
Returns true if the given key is contained in the mapping of this Bundle. |
Object
|
get(String key)
Returns the entry with the given key as an object. |
boolean
|
getBoolean(String key, boolean defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key. |
boolean
|
getBoolean(String key)
Returns the value associated with the given key, or false if no mapping of the desired type exists for the given key. |
boolean[]
|
getBooleanArray(String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
double
|
getDouble(String key, double defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key. |
double
|
getDouble(String key)
Returns the value associated with the given key, or 0.0 if no mapping of the desired type exists for the given key. |
double[]
|
getDoubleArray(String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
int
|
getInt(String key)
Returns the value associated with the given key, or 0 if no mapping of the desired type exists for the given key. |
int
|
getInt(String key, int defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key. |
int[]
|
getIntArray(String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
long
|
getLong(String key)
Returns the value associated with the given key, or 0L if no mapping of the desired type exists for the given key. |
long
|
getLong(String key, long defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key. |
long[]
|
getLongArray(String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
String
|
getString(String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
String
|
getString(String key, String defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key or if a null value is explicitly associated with the given key. |
String[]
|
getStringArray(String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
boolean
|
isEmpty()
Returns true if the mapping of this Bundle is empty, false otherwise. |
Set<String>
|
keySet()
Returns a Set containing the Strings used as keys in this Bundle. |
void
|
putAll(PersistableBundle bundle)
Inserts all mappings from the given PersistableBundle into this BaseBundle. |
void
|
putBoolean(String key, boolean value)
Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putBooleanArray(String key, boolean[] value)
Inserts a boolean array value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putDouble(String key, double value)
Inserts a double value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putDoubleArray(String key, double[] value)
Inserts a double array value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putInt(String key, int value)
Inserts an int value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putIntArray(String key, int[] value)
Inserts an int array value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putLong(String key, long value)
Inserts a long value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putLongArray(String key, long[] value)
Inserts a long array value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putString(String key, String value)
Inserts a String value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
putStringArray(String key, String[] value)
Inserts a String array value into the mapping of this Bundle, replacing any existing value for the given key. |
void
|
remove(String key)
Removes any entry with the given key from the mapping of this Bundle. |
int
|
size()
Returns the number of mappings contained in this Bundle. |
Inherited methods | |
---|---|
Public methods
containsKey
boolean containsKey (String key)
Returns true if the given key is contained in the mapping of this Bundle.
Parameters | |
---|---|
key |
String : a String key |
Returns | |
---|---|
boolean |
true if the key is part of the mapping, false otherwise |
get
Object get (String key)
Returns the entry with the given key as an object.
Parameters | |
---|---|
key |
String : a String key |
Returns | |
---|---|
Object |
an Object, or null |
getBoolean
boolean getBoolean (String key, boolean defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
defaultValue |
boolean : Value to return if key does not exist |
Returns | |
---|---|
boolean |
a boolean value |
getBoolean
boolean getBoolean (String key)
Returns the value associated with the given key, or false if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
Returns | |
---|---|
boolean |
a boolean value |
getBooleanArray
boolean[] getBooleanArray (String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
Parameters | |
---|---|
key |
String : a String, or null |
Returns | |
---|---|
boolean[] |
a boolean[] value, or null |
getDouble
double getDouble (String key, double defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
defaultValue |
double : Value to return if key does not exist |
Returns | |
---|---|
double |
a double value |
getDouble
double getDouble (String key)
Returns the value associated with the given key, or 0.0 if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
Returns | |
---|---|
double |
a double value |
getDoubleArray
double[] getDoubleArray (String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
Parameters | |
---|---|
key |
String : a String, or null |
Returns | |
---|---|
double[] |
a double[] value, or null |
getInt
int getInt (String key)
Returns the value associated with the given key, or 0 if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
Returns | |
---|---|
int |
an int value |
getInt
int getInt (String key, int defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
defaultValue |
int : Value to return if key does not exist |
Returns | |
---|---|
int |
an int value |
getIntArray
int[] getIntArray (String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
Parameters | |
---|---|
key |
String : a String, or null |
Returns | |
---|---|
int[] |
an int[] value, or null |
getLong
long getLong (String key)
Returns the value associated with the given key, or 0L if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
Returns | |
---|---|
long |
a long value |
getLong
long getLong (String key, long defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
Parameters | |
---|---|
key |
String : a String |
defaultValue |
long : Value to return if key does not exist |
Returns | |
---|---|
long |
a long value |
getLongArray
long[] getLongArray (String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
Parameters | |
---|---|
key |
String : a String, or null |
Returns | |
---|---|
long[] |
a long[] value, or null |
getString
String getString (String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
Parameters | |
---|---|
key |
String : a String, or null |
Returns | |
---|---|
String |
a String value, or null |
getString
String getString (String key, String defaultValue)
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key or if a null value is explicitly associated with the given key.
Parameters | |
---|---|
key |
String : a String, or null |
defaultValue |
String : Value to return if key does not exist or if a null
value is associated with the given key. |
Returns | |
---|---|
String |
the String value associated with the given key, or defaultValue if no valid String object is currently mapped to that key. |
getStringArray
String[] getStringArray (String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
Parameters | |
---|---|
key |
String : a String, or null |
Returns | |
---|---|
String[] |
a String[] value, or null |
isEmpty
boolean isEmpty ()
Returns true if the mapping of this Bundle is empty, false otherwise.
Returns | |
---|---|
boolean |
keySet
Set<String> keySet ()
Returns a Set containing the Strings used as keys in this Bundle.
Returns | |
---|---|
Set<String> |
a Set of String keys |
putAll
void putAll (PersistableBundle bundle)
Inserts all mappings from the given PersistableBundle into this BaseBundle.
Parameters | |
---|---|
bundle |
PersistableBundle : a PersistableBundle
|
putBoolean
void putBoolean (String key, boolean value)
Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
Parameters | |
---|---|
key |
String : a String, or null |
value |
boolean : a boolean
|
putBooleanArray
void putBooleanArray (String key, boolean[] value)
Inserts a boolean array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
Parameters | |
---|---|
key |
String : a String, or null |
value |
boolean : a boolean array object, or null
|
putDouble
void putDouble (String key, double value)
Inserts a double value into the mapping of this Bundle, replacing any existing value for the given key.
Parameters | |
---|---|
key |
String : a String, or null |
value |
double : a double
|
putDoubleArray
void putDoubleArray (String key, double[] value)
Inserts a double array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
Parameters | |
---|---|
key |
String : a String, or null |
value |
double : a double array object, or null
|
putInt
void putInt (String key, int value)
Inserts an int value into the mapping of this Bundle, replacing any existing value for the given key.
Parameters | |
---|---|
key |
String : a String, or null |
value |
int : an int
|
putIntArray
void putIntArray (String key, int[] value)
Inserts an int array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
Parameters | |
---|---|
key |
String : a String, or null |
value |
int : an int array object, or null
|
putLong
void putLong (String key, long value)
Inserts a long value into the mapping of this Bundle, replacing any existing value for the given key.
Parameters | |
---|---|
key |
String : a String, or null |
value |
long : a long
|
putLongArray
void putLongArray (String key, long[] value)
Inserts a long array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
Parameters | |
---|---|
key |
String : a String, or null |
value |
long : a long array object, or null
|
putString
void putString (String key, String value)
Inserts a String value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
Parameters | |
---|---|
key |
String : a String, or null |
value |
String : a String, or null
|
putStringArray
void putStringArray (String key, String[] value)
Inserts a String array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
Parameters | |
---|---|
key |
String : a String, or null |
value |
String : a String array object, or null
|
remove
void remove (String key)
Removes any entry with the given key from the mapping of this Bundle.
Parameters | |
---|---|
key |
String : a String key
|
size
int size ()
Returns the number of mappings contained in this Bundle.
Returns | |
---|---|
int |
the number of mappings as an int. |
Interfaces
- CancellationSignal.OnCancelListener
- Handler.Callback
- IBinder
- IBinder.DeathRecipient
- IInterface
- MessageQueue.IdleHandler
- MessageQueue.OnFileDescriptorEventListener
- Parcelable
- Parcelable.ClassLoaderCreator
- Parcelable.Creator
- ParcelFileDescriptor.OnCloseListener
- RecoverySystem.ProgressListener
- StrictMode.OnThreadViolationListener
- StrictMode.OnVmViolationListener
Classes
- AsyncTask
- BaseBundle
- BatteryManager
- Binder
- Build
- Build.VERSION
- Build.VERSION_CODES
- Bundle
- CancellationSignal
- ConditionVariable
- CountDownTimer
- CpuUsageInfo
- Debug
- Debug.InstructionCount
- Debug.MemoryInfo
- DropBoxManager
- DropBoxManager.Entry
- Environment
- FileObserver
- Handler
- HandlerThread
- HardwarePropertiesManager
- LocaleList
- Looper
- MemoryFile
- Message
- MessageQueue
- Messenger
- Parcel
- ParcelFileDescriptor
- ParcelFileDescriptor.AutoCloseInputStream
- ParcelFileDescriptor.AutoCloseOutputStream
- ParcelUuid
- PatternMatcher
- PersistableBundle
- PowerManager
- PowerManager.WakeLock
- Process
- ProxyFileDescriptorCallback
- RecoverySystem
- RemoteCallbackList
- ResultReceiver
- SharedMemory
- StatFs
- StrictMode
- StrictMode.ThreadPolicy
- StrictMode.ThreadPolicy.Builder
- StrictMode.VmPolicy
- StrictMode.VmPolicy.Builder
- SystemClock
- TestLooperManager
- TokenWatcher
- Trace
- UserHandle
- UserManager
- VibrationEffect
- Vibrator
- WorkSource
Enums
Exceptions