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

The following examples show how to use android.os.Bundle#putString() . 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 check out the related API usage on the sidebar.
Example 1
Source File: ScoreActivity.java    From KUAS-AP-Material with 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
Source File: TrackingUtil.java    From Augendiagnose with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
Source File: RouteParamFragment.java    From pandora with 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 4
Source File: PostReadNotificationRequest.java    From Klyph with MIT License 5 votes vote down vote up
@Override
public Bundle getParams()
{
	Bundle bundle = new Bundle();
	bundle.putString("unread", "0");
	return bundle;
}
 
Example 5
Source File: ChatMessagesFragment.java    From revolution-irc with GNU General Public License v3.0 5 votes vote down vote up
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 6
Source File: HostLiveStreamingProfile.java    From DeviceConnect-Android with MIT License 5 votes vote down vote up
@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 7
Source File: ChatViewFragment.java    From weMessage with GNU Affero General Public License v3.0 5 votes vote down vote up
@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 8
Source File: DoorsNLocksAccessListFragment.java    From arcusandroid with Apache License 2.0 5 votes vote down vote up
@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 9
Source File: DataListPreferenceDialogFragmentCompat.java    From IslamicLibraryAndroid with GNU General Public License v3.0 5 votes vote down vote up
@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 10
Source File: RecordManager.java    From MiBandDecompiled with 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 11
Source File: ShaderListPreferenceDialogFragment.java    From ShaderEditor with MIT License 5 votes vote down vote up
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 12
Source File: AmenitySetupDialog.java    From trekarta with GNU General Public License v3.0 5 votes vote down vote up
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 13
Source File: DurationPickerDialogFragment.java    From Jockey with Apache License 2.0 5 votes vote down vote up
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 14
Source File: TopicPostFragment.java    From NGA-CLIENT-VER-OPEN-SOURCE with GNU General Public License v2.0 5 votes vote down vote up
@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 15
Source File: NewsFragment.java    From ImmersionBar with 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 16
Source File: InstallerXDialogFragment.java    From SAI with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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 17
Source File: LocalMediaFileListFragment.java    From Kore with 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 18
Source File: ShotLikeListPresenter.java    From Protein with 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 19
Source File: ReservedRegion.java    From Pincho-Usb-Mass-Storage-for-Android with MIT License 5 votes vote down vote up
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 20
Source File: SearchActivity.java    From Infinity-For-Reddit with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(SUBREDDIT_NAME_STATE, subredditName);
    outState.putBoolean(SUBREDDIT_IS_USER_STATE, subredditIsUser);
}