當前位置: 首頁>>代碼示例>>Java>>正文


Java Bundle.getShort方法代碼示例

本文整理匯總了Java中android.os.Bundle.getShort方法的典型用法代碼示例。如果您正苦於以下問題:Java Bundle.getShort方法的具體用法?Java Bundle.getShort怎麽用?Java Bundle.getShort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.getShort方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unbundle

import android.os.Bundle; //導入方法依賴的package包/類
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()));
}
 
開發者ID:uber,項目名稱:auto-value-bundle,代碼行數:29,代碼來源:AutoValue_TestClassBundled.java

示例2: getData

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * 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;
}
 
開發者ID:josesamuel,項目名稱:RxRemote,代碼行數:40,代碼來源:RemoteObservable.java

示例3: getShort

import android.os.Bundle; //導入方法依賴的package包/類
public short getShort(Bundle state, String key) {
    return state.getShort(key + baseKey);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:Injector.java

示例4: getBoxedShort

import android.os.Bundle; //導入方法依賴的package包/類
public Short getBoxedShort(Bundle state, String key) {
    if (state.containsKey(key + baseKey)) {
        return state.getShort(key + baseKey);
    }
    return null;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:Injector.java

示例5: getShort

import android.os.Bundle; //導入方法依賴的package包/類
public short getShort(Bundle state, String key) {
    return state.getShort(key + mBaseKey);
}
 
開發者ID:evernote,項目名稱:android-state,代碼行數:4,代碼來源:InjectionHelper.java

示例6: getBoxedShort

import android.os.Bundle; //導入方法依賴的package包/類
public Short getBoxedShort(Bundle state, String key) {
    if (state.containsKey(key + mBaseKey)) {
        return state.getShort(key + mBaseKey);
    }
    return null;
}
 
開發者ID:evernote,項目名稱:android-state,代碼行數:7,代碼來源:InjectionHelper.java


注:本文中的android.os.Bundle.getShort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。