本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例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");
}
}
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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);
}
示例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;
}
示例15: getBundle
import android.os.Bundle; //导入方法依赖的package包/类
public Bundle getBundle(Bundle state, String key) {
return state.getBundle(key + mBaseKey);
}