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


Java Bundle.getBundle方法代碼示例

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


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

示例1: createFromAlApplinkData

import android.os.Bundle; //導入方法依賴的package包/類
private static AppLinkData createFromAlApplinkData(Intent intent) {
    Bundle applinks = intent.getBundleExtra(BUNDLE_AL_APPLINK_DATA_KEY);
    if (applinks == null) {
        return null;
    }

    AppLinkData appLinkData = new AppLinkData();
    appLinkData.targetUri = intent.getData();
    if (appLinkData.targetUri == null) {
        String targetUriString = applinks.getString(METHOD_ARGS_TARGET_URL_KEY);
        if (targetUriString != null) {
            appLinkData.targetUri = Uri.parse(targetUriString);
        }
    }
    appLinkData.argumentBundle = applinks;
    appLinkData.arguments = null;
    Bundle refererData = applinks.getBundle(ARGUMENTS_REFERER_DATA_KEY);
    if (refererData != null) {
        appLinkData.ref = refererData.getString(REFERER_DATA_REF_KEY);
    }

    return appLinkData;
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:24,代碼來源:AppLinkData.java

示例2: createFromAlApplinkData

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Parses out any app link data from the Intent passed in.
 * @param intent Intent from the Activity that started because of an app link
 * @return AppLinkData if found. null if not.
 */
public static AppLinkData createFromAlApplinkData(Intent intent) {
    Bundle applinks = intent.getBundleExtra(BUNDLE_AL_APPLINK_DATA_KEY);
    if (applinks == null) {
        return null;
    }

    AppLinkData appLinkData = new AppLinkData();
    appLinkData.targetUri = intent.getData();
    if (appLinkData.targetUri == null) {
        String targetUriString = applinks.getString(METHOD_ARGS_TARGET_URL_KEY);
        if (targetUriString != null) {
            appLinkData.targetUri = Uri.parse(targetUriString);
        }
    }
    appLinkData.argumentBundle = applinks;
    appLinkData.arguments = null;
    Bundle refererData = applinks.getBundle(ARGUMENTS_REFERER_DATA_KEY);
    if (refererData != null) {
        appLinkData.ref = refererData.getString(REFERER_DATA_REF_KEY);
    }

    return appLinkData;
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:29,代碼來源:AppLinkData.java

示例3: onCreate

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    final Bundle mapViewSavedInstanceState = savedInstanceState != null ? savedInstanceState.getBundle(KEY_MAPVIEW_SAVE_INSTANCE) : null;
    super.onCreate(mapViewSavedInstanceState);

    // Load last measure
    mCallbacks = new DataBaseLoader(getActivity(),this);
    if (mMapView != null) {
        mMapView.onCreate(savedInstanceState);
    }

    if (savedInstanceState != null) {
        showHeatMap = savedInstanceState.getBoolean(KEY_SHOW_HEATMAP);
        showStations = savedInstanceState.getBoolean(KEY_SHOW_STATIONS);
    }
}
 
開發者ID:medialab-prado,項目名稱:puremadrid,代碼行數:17,代碼來源:MyMapFragment.java

示例4: d

import android.os.Bundle; //導入方法依賴的package包/類
public d(Bundle bundle) {
    this.h = bundle.getString("ext_to");
    this.i = bundle.getString("ext_from");
    this.j = bundle.getString("ext_chid");
    this.g = bundle.getString("ext_pkt_id");
    Parcelable[] parcelableArray = bundle.getParcelableArray("ext_exts");
    if (parcelableArray != null) {
        this.l = new ArrayList(parcelableArray.length);
        for (Parcelable parcelable : parcelableArray) {
            a a = a.a((Bundle) parcelable);
            if (a != null) {
                this.l.add(a);
            }
        }
    }
    Bundle bundle2 = bundle.getBundle("ext_ERROR");
    if (bundle2 != null) {
        this.n = new h(bundle2);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:21,代碼來源:d.java

示例5: restoreStateParams

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void restoreStateParams(Bundle bundle) {
    currentParams = bundle.getBundle("smsview_params_" + currentType);
    if (currentParams != null) {
        setParams(currentParams);
    }
    String code = bundle.getString("smsview_code_" + currentType);
    if (code != null) {
        codeField.setText(code);
    }
    int t = bundle.getInt("time");
    if (t != 0) {
        time = t;
    }
    int t2 = bundle.getInt("open");
    if (t2 != 0) {
        openTime = t2;
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:20,代碼來源:LoginActivity.java

示例6: getResultsResponse

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Build and return a new ResultResponse instant using the arguments passed in.
 *
 * @param arguments  Used to retrieve the ID and request code for the fragment
 *                   requesting the results.
 * @param resultCode The results code to be returned.
 * @param data       Used to return extra data that might be required.
 * @return a new {@link ResultResponse} instance
 */
public static ResultResponse getResultsResponse(Bundle arguments, int resultCode, Bundle data) {
    if (arguments == null || !arguments.containsKey(KEY_REQUEST_BUNDLE)) {
        return null;
    }

    ResultResponse resultResponse = new ResultResponse();
    resultResponse.resultCode = resultCode;
    resultResponse.data = data;

    Bundle requestBundle = arguments.getBundle(KEY_REQUEST_BUNDLE);

    if (requestBundle != null) {
        resultResponse.fragmentId = requestBundle.getString(KEY_FRAGMENT_ID);
        resultResponse.requestCode = requestBundle.getInt(KEY_REQUEST_CODE);
    }

    return resultResponse;
}
 
開發者ID:Fueled,項目名稱:flowr,代碼行數:28,代碼來源:Flowr.java

示例7: initData

import android.os.Bundle; //導入方法依賴的package包/類
private void initData() {
    Intent intent = getIntent();
    Bundle bundle = intent.getExtras();
    if (bundle != null) {
        Bundle data = bundle.getBundle("extra");
        if (data != null) {
            author = data.getString("author");
            url = data.getString("url");
            images = data.getStringArrayList("images");
            newid = data.getString("new_id");
            title = data.getString("title");
        }
    }
}
 
開發者ID:struggledhard,項目名稱:USay,代碼行數:15,代碼來源:WebViewFenLeiActivity.java

示例8: SingleChoiceMode

import android.os.Bundle; //導入方法依賴的package包/類
public SingleChoiceMode(@Nullable final Bundle savedInstanceState) {
    super();
    final Bundle state = (savedInstanceState != null ?
            savedInstanceState.getBundle(KEY_SINGLE_CHOICE_MODE) : null);
    if (state != null) {
        mCheckedId = state.getLong(KEY_CHECKED_ID, RecyclerView.NO_ID);
    }
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:9,代碼來源:SingleChoiceMode.java

示例9: getErrorDataFromResultIntent

import android.os.Bundle; //導入方法依賴的package包/類
public static Bundle getErrorDataFromResultIntent(Intent resultIntent) {
    if (!isErrorResult(resultIntent)) {
        return null;
    }

    Bundle bridgeArgs = getBridgeArgumentsFromIntent(resultIntent);
    if (bridgeArgs != null) {
        return bridgeArgs.getBundle(BRIDGE_ARG_ERROR_BUNDLE);
    }

    return resultIntent.getExtras();
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:13,代碼來源:NativeProtocol.java

示例10: restoreStateParams

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void restoreStateParams(Bundle bundle) {
    currentParams = bundle.getBundle("passview_params");
    if (currentParams != null) {
        setParams(currentParams);
    }
    String code = bundle.getString("passview_code");
    if (code != null) {
        codeField.setText(code);
    }
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:12,代碼來源:LoginActivity.java

示例11: restoreManagedDialogs

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Restore the state of any saved managed dialogs.
 *
 * @param savedInstanceState The bundle to restore from.
 */
private void restoreManagedDialogs(Bundle savedInstanceState) {
    final Bundle b = savedInstanceState.getBundle(SAVED_DIALOGS_TAG);
    if (b == null) {
        return;
    }

    final int[] ids = b.getIntArray(SAVED_DIALOG_IDS_KEY);
    final int numDialogs = ids.length;
    mManagedDialogs = new SparseArray<ManagedDialog>(numDialogs);
    for (int i = 0; i < numDialogs; i++) {
        final Integer dialogId = ids[i];
        Bundle dialogState = b.getBundle(savedDialogKeyFor(dialogId));
        if (dialogState != null) {
            // Calling onRestoreInstanceState() below will invoke dispatchOnCreate
            // so tell createDialog() not to do it, otherwise we get an exception
            final ManagedDialog md = new ManagedDialog();
            md.mArgs = b.getBundle(savedDialogArgsKeyFor(dialogId));
            md.mDialog = createDialog(dialogId, dialogState, md.mArgs);
            if (md.mDialog != null) {
                mManagedDialogs.put(dialogId, md);
                onPrepareDialog(dialogId, md.mDialog, md.mArgs);
                md.mDialog.onRestoreInstanceState(dialogState);
            }
        }
    }
}
 
開發者ID:JessYanCoding,項目名稱:ProgressManager,代碼行數:32,代碼來源:a.java

示例12: initData

import android.os.Bundle; //導入方法依賴的package包/類
private void initData() {
    Intent intent = getIntent();
    Bundle bundle = intent.getExtras();
    if (bundle != null) {
        Bundle data = bundle.getBundle("data");
        if (data != null) {
            authorId = data.getString("authorId");
            imgHeadLink = data.getString("imgHeadLink");
            contentUrl = data.getString("contentUrl");
            Log.d("contentUrl", contentUrl);
        }
    }
}
 
開發者ID:struggledhard,項目名稱:USay,代碼行數:14,代碼來源:WebViewActivity.java

示例13: deserialize

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Read a field's value from the saved state {@link Bundle}.
 *
 * @param state {@link Bundle} used to save the state
 * @param key   key retrieved from {@code fieldDeclaringClass#fieldName}
 * @return value of the field
 */
@SuppressWarnings("ConstantConditions")
@Override
public FieldType deserialize(@NonNull Bundle state, @NonNull String key) {
    Bundle bundle = state.getBundle(key);
    if (bundle == null)
        return null;

    Class jsonClass = (Class) bundle.getSerializable(CLASS_KEY);
    String jsonString = bundle.getString(VALUE_KEY);
    //noinspection unchecked
    return (FieldType) gson().fromJson(jsonString, jsonClass);
}
 
開發者ID:Fondesa,項目名稱:Lyra,代碼行數:20,代碼來源:DefaultGsonCoder.java

示例14: restoreInstanceState

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Call this from onCreate() so that any saved startActivityForResult parameters will be restored.
 */
public void restoreInstanceState(Bundle savedInstanceState) {
    initCallbackService = savedInstanceState.getString("callbackService");
    savedPluginState = savedInstanceState.getBundle("plugin");
    activityWasDestroyed = true;
}
 
開發者ID:alex-shpak,項目名稱:keemob,代碼行數:9,代碼來源:CordovaInterfaceImpl.java

示例15: getBundle

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


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