Java Code Examples for android.os.Bundle.getChar()

The following are Jave code examples for showing how to use getChar() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: auto-value-bundle   File: AutoValue_TestClassBundled.java   View Source Code Vote up 6 votes
public static TestClassBundled unbundle(Bundle bundle, Gson gson) {
    return new AutoValue_TestClassBundled(
            bundle,
            bundle.getByte("some_byte"),
            bundle.getBoolean("some_boolean"),
            bundle.getShort("some_short"),
            bundle.getInt("some_int"),
            bundle.getLong("some_long"),
            bundle.getChar("some_char"),
            bundle.getFloat("some_float"),
            bundle.getDouble("some_double"),
            bundle.getString("some_string"),
            bundle.getCharSequence("some_char_sequence"),
            bundle.getParcelable("some_parcelable"),
            bundle.getParcelableArrayList("some_parcelable_array_list"),
            bundle.getSparseParcelableArray("some_parcelable_sparse_array"),
            bundle.getSerializable("some_serializable"),
            bundle.getIntegerArrayList("some_integer_array_list"),
            bundle.getStringArrayList("some_string_array_list"),
            bundle.getCharSequenceArrayList("some_char_sequence_array_list"),
            bundle.getByteArray("some_byte_array"),
            bundle.getShortArray("some_short_array"),
            bundle.getCharArray("some_char_array"),
            bundle.getFloatArray("some_float_array"),
            gson.fromJson(bundle.getString("some_unknown_object"), new com.google.common.reflect.TypeToken<UnknownObject>(){}.getType()),
            gson.fromJson(bundle.getString("some_unknown_object_list"), new com.google.common.reflect.TypeToken<ArrayList<UnknownObject>>(){}.getType()),
            gson.fromJson(bundle.getString("test_enum"), new com.google.common.reflect.TypeToken<TestEnum>(){}.getType()));
}
 
Example 2
Project: RxRemote   File: RemoteObservable.java   View Source Code Vote up 5 votes
/**
 * Reads and returns the correct type of data from the bundle
 */
@SuppressWarnings("unchecked")
private Object getData(Bundle remoteData, RemoteDataType dataType, String keyPrefix) {
    if (DEBUG) {
        Log.v(TAG, "Parsing datatype " + dataType);
    }
    switch (dataType) {
        case Parcelable:
            return remoteData.getParcelable(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Double:
            return remoteData.getDouble(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Float:
            return remoteData.getFloat(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Integer:
            return remoteData.getInt(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Long:
            return remoteData.getLong(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Byte:
            return remoteData.getByte(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Char:
            return remoteData.getChar(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Short:
            return remoteData.getShort(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case String:
            return remoteData.getString(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Boolean:
            return (remoteData.getInt(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix) == 1);
        case Parceler:
            return getParcelerData(remoteData, keyPrefix);
        case Remoter:
            return getRemoterData(remoteData, keyPrefix);
        case List:
            return getListData(remoteData, keyPrefix);

    }
    return null;
}
 
Example 3
Project: GitHub   File: Injector.java   View Source Code Vote up 4 votes
public char getChar(Bundle state, String key) {
    return state.getChar(key + baseKey);
}
 
Example 4
Project: GitHub   File: Injector.java   View Source Code Vote up 4 votes
public Character getBoxedChar(Bundle state, String key) {
    if (state.containsKey(key + baseKey)) {
        return state.getChar(key + baseKey);
    }
    return null;
}
 
Example 5
Project: android-state   File: InjectionHelper.java   View Source Code Vote up 4 votes
public char getChar(Bundle state, String key) {
    return state.getChar(key + mBaseKey);
}
 
Example 6
Project: android-state   File: InjectionHelper.java   View Source Code Vote up 4 votes
public Character getBoxedChar(Bundle state, String key) {
    if (state.containsKey(key + mBaseKey)) {
        return state.getChar(key + mBaseKey);
    }
    return null;
}