Java Code Examples for android.os.Bundle#putString()

The following examples show how to use android.os.Bundle#putString() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: KUAS-AP-Material   File: ScoreActivity.java    License: MIT License 6 votes vote down vote up
@Override
public void onSaveInstanceState(Bundle outState) {
	super.onSaveInstanceState(outState);

	outState.putString("mYms", mYms);
	outState.putBoolean("isRetry", isRetry);
	if (mScrollView != null) {
		outState.putInt("mPos", mScrollView.getVerticalScrollbarPosition());
	}
	if (mList != null) {
		outState.putString("mList", new Gson().toJson(mList));
	}
	if (mSelectedModel != null) {
		outState.putString("mSelectedModel", new Gson().toJson(mSelectedModel));
	}
	if (mSemesterList != null) {
		outState.putString("mSemesterList", new Gson().toJson(mSemesterList));
	}
	if (mScoreDetailModel != null) {
		outState.putString("mScoreDetailModel", new Gson().toJson(mScoreDetailModel));
	}
}
 
Example 2
/**
 * Send timing information.
 *
 * @param category The event category.
 * @param variable The variable.
 * @param label    The label.
 * @param duration The duration.
 */
public static void sendTiming(final Category category, final String variable, final String label, final long duration) {
	getDefaultFirebaseAnalytics();

	Bundle params = new Bundle();
	params.putString("category", category.toString());
	params.putString("variable", variable);
	if (label == null) {
		params.putString("label", variable);
	}
	else {
		params.putString("label", variable + " - " + label);
	}
	params.putLong("value", duration);
	mFirebaseAnalytics.logEvent("Timing", params);
}
 
Example 3
public AmenitySetupDialog create() {
    AmenitySetupDialog dialogFragment = new AmenitySetupDialog();
    Bundle args = new Bundle();

    if (mTitle != null)
        args.putString("title", mTitle);
    dialogFragment.setCallback(mCallback);
    dialogFragment.setArguments(args);
    return dialogFragment;
}
 
Example 4
public Bundle getReadableReservedRegion()
{
    Bundle bundle = new Bundle();
    bundle.putString("bytesPerSector", String.valueOf(bytesPerSector));
    bundle.putString("sectorsPerCluster", String.valueOf(sectorsPerCluster));
    bundle.putString("numberReservedSectors", String.valueOf(numberReservedSectors));
    bundle.putString("fatCopies", String.valueOf(fatCopies));
    bundle.putString("numberSectorsPerFat", String.valueOf(numberSectorsPerFat));
    bundle.putString("rootFirstCluster", String.valueOf(rootFirstCluster));
    return bundle;
}
 
Example 5
Source Project: Protein   File: ShotLikeListPresenter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putParcelable(STATE_USER, user);
    if (firstPageShotLikes.size() > 0) {
        outState.putParcelableArrayList(STATE_FIRST_PAGE_DATA, (ArrayList<? extends Parcelable>) firstPageShotLikes);
    }
    outState.putString(STATE_NEXT_PAGE_URL, getNextPageUrl());
}
 
Example 6
Source Project: Kore   File: LocalMediaFileListFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(MEDIA_TYPE, mediaType);
    outState.putParcelable(SORT_METHOD, sortMethod);
    try {
        outState.putParcelableArrayList(PATH_CONTENTS, (ArrayList<LocalFileLocation>) ((MediaPictureListAdapter) getAdapter()).getFileItemList());
    } catch (NullPointerException npe) {
        // adapter is null probably nothing was save in bundle because the directory is empty
        // ignore this so that the empty message would display later on
    }
    outState.putParcelableArrayList(ROOT_PATH_CONTENTS, rootFileLocation);
    outState.putBoolean(ROOT_VISITED, browseRootAlready);
}
 
Example 7
/**
 * Create an instance of InstallerXDialogFragment with given apk source uri and UriHostFactory class.
 * If {@code apkSourceUri} is null, dialog will let user pick apk source file.
 * If {@code uriHostFactoryClass} is null, {@link com.aefyr.sai.installerx.resolver.urimess.impl.AndroidUriHost} will be used.
 *
 * @param apkSourceUri
 * @param uriHostFactoryClass
 * @return
 */
public static InstallerXDialogFragment newInstance(@Nullable Uri apkSourceUri, @Nullable Class<? extends UriHostFactory> uriHostFactoryClass) {
    Bundle args = new Bundle();
    if (apkSourceUri != null)
        args.putParcelable(ARG_APK_SOURCE_URI, apkSourceUri);

    if (uriHostFactoryClass != null)
        args.putString(ARG_URI_HOST_FACTORY, uriHostFactoryClass.getCanonicalName());

    InstallerXDialogFragment fragment = new InstallerXDialogFragment();
    fragment.setArguments(args);

    return fragment;
}
 
Example 8
Source Project: ImmersionBar   File: NewsFragment.java    License: Apache License 2.0 5 votes vote down vote up
public static NewsFragment newInstance(String title) {
    NewsFragment newsFragment = new NewsFragment();
    Bundle bundle = new Bundle();
    bundle.putString("title", title);
    newsFragment.setArguments(bundle);
    return newsFragment;
}
 
Example 9
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString("body", mBodyEditText.getText().toString());
    outState.putString("title", mTitleEditText.getText().toString());
    outState.putBoolean("anoay", mAnonyCheckBox.isChecked());
}
 
Example 10
public void show(String tag) {
    Bundle args = new Bundle();
    args.putString(KEY_TITLE, mTitle);
    args.putInt(KEY_MIN_VAL, mMin);
    args.putInt(KEY_MAX_VAL, mMax);
    args.putString(KEY_DISABLE_BUTTON, mDisableButton);
    args.putInt(KEY_DEFAULT_VAL, mDefault);

    DurationPickerDialogFragment dialogFragment = new DurationPickerDialogFragment();
    dialogFragment.setArguments(args);

    dialogFragment.setTargetFragment(mTargetFragment, 0);
    dialogFragment.show(mFragmentManager, tag);
}
 
Example 11
Source Project: pandora   File: RouteParamFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onEditReq(String def, @RouteParamItem.Type int type) {
    Bundle bundle = new Bundle();
    bundle.putString(PARAM1, def);
    if (type == RouteParamItem.Type.BOOLEAN) {
        bundle.putStringArray(PARAM3, Utils.newArray("true", "false"));
        bundle.putBoolean(PARAM4, true);
    } else {
        bundle.putBoolean(PARAM2, type != RouteParamItem.Type.STRING);
    }
    launch(EditFragment.class, bundle, CODE1);
}
 
Example 12
public static ShaderListPreferenceDialogFragment newInstance(
		String key) {
	Bundle bundle = new Bundle();
	bundle.putString(ARG_KEY, key);

	ShaderListPreferenceDialogFragment fragment =
			new ShaderListPreferenceDialogFragment();
	fragment.setArguments(bundle);

	return fragment;
}
 
Example 13
Source Project: MiBandDecompiled   File: RecordManager.java    License: Apache License 2.0 5 votes vote down vote up
public void deleteRecord(String s, IUiListener iuilistener)
{
    Bundle bundle = composeCGIParams();
    com.tencent.connect.common.BaseApi.TempRequestListener temprequestlistener = new com.tencent.connect.common.BaseApi.TempRequestListener(this, new k(this, iuilistener));
    bundle.putString("key", Util.toHexString(s));
    HttpUtils.requestAsync(mToken, mContext, "https://graph.qq.com/weiyun/delete_record", bundle, "GET", temprequestlistener);
}
 
Example 14
@NonNull
public static DataListPreferenceDialogFragmentCompat newInstance(@NonNull Preference preference) {
    DataListPreferenceDialogFragmentCompat fragment = new DataListPreferenceDialogFragmentCompat();
    Bundle bundle = new Bundle(1);
    bundle.putString("key", preference.getKey());
    fragment.setArguments(bundle);
    return fragment;
}
 
Example 15
@NonNull
public static DoorsNLocksAccessListFragment newInstance(AccessSummary subsystem) {
    DoorsNLocksAccessListFragment fragment = new DoorsNLocksAccessListFragment();
    Bundle bundle = new Bundle();
    bundle.putString(ACCESS_NAME_KEY,subsystem.getName());
    bundle.putString(ACCESS_DEVICE_ID_KEY, subsystem.getDeviceId());
    fragment.setArguments(bundle);
    return fragment;
}
 
Example 16
@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putBoolean(BUNDLE_IS_IN_EDIT_MODE, isInEditMode);
    outState.putBoolean(BUNDLE_IS_CHOOSE_PHOTO_LAYOUT_SHOWN, isChoosePhotoLayoutShown);

    outState.putString(weMessage.BUNDLE_CONVERSATION_CHAT, chatUuid);
    outState.putString(BUNDLE_EDITED_NAME, editedName);
    outState.putString(BUNDLE_EDITED_PICTURE, editedChatPicture);

    super.onSaveInstanceState(outState);
}
 
Example 17
@Override
public void onStop() {
    if (DEBUG) {
        Log.d(TAG, "onStop()");
    }
    if (mCurrentResponse != null) {
        setResult(mCurrentResponse, DConnectMessage.RESULT_OK);
        sendResponse(mCurrentResponse);
        mCurrentResponse = null;
    }

    for(Event event : EventManager.INSTANCE.getEventList(getService().getId(), PROFILE_NAME, null, AT_ON_STATUS_CHANGE)) {
        Bundle root = new Bundle();
        Bundle streaming = new Bundle();
        streaming.putString(PARAM_KEY_URI, mHostDeviceLiveStreamRecorder.getBroadcastURI());
        streaming.putString(PARAM_KEY_STATUS, "stop");

        Bundle video = new Bundle();
        video.putString(PARAM_KEY_URI, mVideoURI);
        video.putInt(PARAM_KEY_WIDTH, mHostDeviceLiveStreamRecorder.getVideoWidth());
        video.putInt(PARAM_KEY_HEIGHT, mHostDeviceLiveStreamRecorder.getVideoHeight());
        video.putInt(PARAM_KEY_BITRATE, mHostDeviceLiveStreamRecorder.getBitrate());
        video.putInt(PARAM_KEY_FRAME_RATE, mHostDeviceLiveStreamRecorder.getFrameRate());
        video.putString(PARAM_KEY_MIME_TYPE, mHostDeviceLiveStreamRecorder.getLiveStreamingMimeType());
        streaming.putParcelable(PARAM_KEY_VIDEO, video);

        root.putParcelable(PARAM_KEY_STREAMING, streaming);

        sendEvent(event, root);
    }
}
 
Example 18
public static ChatMessagesFragment newStatusInstance(ServerConnectionInfo server) {
    ChatMessagesFragment fragment = new ChatMessagesFragment();
    Bundle args = new Bundle();
    args.putString(ARG_SERVER_UUID, server.getUUID().toString());
    args.putBoolean(ARG_DISPLAY_STATUS, true);
    fragment.setArguments(args);
    return fragment;
}
 
Example 19
Source Project: Klyph   File: PostReadNotificationRequest.java    License: MIT License 5 votes vote down vote up
@Override
public Bundle getParams()
{
	Bundle bundle = new Bundle();
	bundle.putString("unread", "0");
	return bundle;
}
 
Example 20
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(SUBREDDIT_NAME_STATE, subredditName);
    outState.putBoolean(SUBREDDIT_IS_USER_STATE, subredditIsUser);
}