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

The following are Jave code examples for showing how to use putString() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Sega   File: ProfileProductSold.java   View Source Code Vote up 6 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_product_profile);
    ButterKnife.bind(this);
    if (savedInstanceState == null) {
        ProductSoldFragmentProfile fragment = new ProductSoldFragmentProfile();
        Bundle args = new Bundle();
        Bundle extras = getIntent().getExtras();
        System.out.println(getIntent().getStringExtra(ViMarket.seller_ID));
        args.putString(ViMarket.seller_ID,  getIntent().getStringExtra(ViMarket.seller_ID));
        fragment.setArguments(args);
        getSupportFragmentManager().beginTransaction().replace(R.id.product_profile_container, fragment).commit();

    }
    Intent returnIntent = new Intent();
    setResult(Activity.RESULT_CANCELED, returnIntent);

}
 
Example 2
Project: letv   File: JavaScriptinterface.java   View Source Code Vote up 6 votes
@JavascriptInterface
public void fun_openImage(String jsonString) {
    JSInBean jsInBean = JSBridgeUtil.getInstance().parseJsonArray(jsonString);
    try {
        int options = (int) (new JSONObject(jsInBean.getName()).getDouble("scale") * 100.0d);
        if (this.activityHandler != null) {
            Message message = new Message();
            message.what = 3;
            message.obj = Integer.valueOf(options);
            Bundle bundle = new Bundle();
            bundle.putString(a.c, jsInBean.getCallback());
            bundle.putString("callback_id", jsInBean.getCallback_id());
            message.setData(bundle);
            this.activityHandler.sendMessage(message);
        }
    } catch (JSONException e) {
        e.printStackTrace();
    }
    android.content.Intent intent = new android.content.Intent("android.intent.action.PICK");
    intent.setType("image/*");
    this.mActivity.startActivityForResult(intent, 10002);
}
 
Example 3
Project: COB   File: CameraLauncher.java   View Source Code Vote up 6 votes
/**
 * Taking or choosing a picture launches another Activity, so we need to implement the
 * save/restore APIs to handle the case where the CordovaActivity is killed by the OS
 * before we get the launched Activity's result.
 */
public Bundle onSaveInstanceState() {
    Bundle state = new Bundle();
    state.putInt("destType", this.destType);
    state.putInt("srcType", this.srcType);
    state.putInt("mQuality", this.mQuality);
    state.putInt("targetWidth", this.targetWidth);
    state.putInt("targetHeight", this.targetHeight);
    state.putInt("encodingType", this.encodingType);
    state.putInt("mediaType", this.mediaType);
    state.putInt("numPics", this.numPics);
    state.putBoolean("allowEdit", this.allowEdit);
    state.putBoolean("correctOrientation", this.correctOrientation);
    state.putBoolean("saveToPhotoAlbum", this.saveToPhotoAlbum);

    if (this.croppedUri != null) {
        state.putString("croppedUri", this.croppedUri.toString());
    }

    if (this.imageUri != null) {
        state.putString("imageUri", this.imageUri.getFileUri().toString());
    }

    return state;
}
 
Example 4
Project: HiBangClient   File: LoginActivity.java   View Source Code Vote up 6 votes
public void handleMessage(Message msg) {
	HiBangUser user = ((SLoginMsg)msg.obj).getUser();
	if (user.getUserID() == -1) {
		//MyToast.ShowMessage(LoginActivity.this, "登录失败,账号或密码错误");
		showCustomToast("登录失败,账号或密码错误");
		closeLoadingDialog();
	} else if(user.getUserID() == -2) { 
	//	MyToast.ShowMessage(LoginActivity.this, "登录失败,重复登录!");
		showCustomToast("登录失败,重复登录!");
		closeLoadingDialog();
	}
	else {
		//MyToast.ShowMessage(LoginActivity.this, "登陆成功" );
		showCustomToast("登陆成功!");
		closeLoadingDialog();
		application.setUser(user);
		String psd = mEtPwd.getText().toString(); 
		application.getHiBang().storeAccessToken(user, psd, String.valueOf(user.hashCode()), System.currentTimeMillis()+7*24*60*60*1000);
		Intent intent = new Intent(LoginActivity.this,MainTabActivity.class);
		Bundle bundle = new Bundle();
		bundle.putString("className", MessageActivity.class.getName());
		intent.putExtras(bundle);
		LoginActivity.this.startActivity(intent);
		LoginActivity.this.finish();
	}
}
 
Example 5
Project: SimpleRssReader   File: MainActivity.java   View Source Code Vote up 6 votes
@Override
public void onSaveInstanceState(final Bundle outState) {
    super.onSaveInstanceState(outState);

    final FragmentManager fm = getFragmentManager();

    if (fm.findFragmentByTag(CurrentFeedFragment.TAG) != null) {
        outState.putString(KEY_FRAGMENT_TAG, CurrentFeedFragment.TAG);
    } else if (fm.findFragmentByTag(FeedSubscriptionsFragment.TAG) != null) {
        outState.putString(KEY_FRAGMENT_TAG, FeedSubscriptionsFragment.TAG);
    } else if (fm.findFragmentByTag(SavedEntriesFragment.TAG) != null) {
        outState.putString(KEY_FRAGMENT_TAG, SavedEntriesFragment.TAG);
    } else if (fm.findFragmentByTag(InitialSetupFragment.TAG) != null) {
        outState.putString(KEY_FRAGMENT_TAG, InitialSetupFragment.TAG);
    } else if (fm.findFragmentByTag(LoadCurrentFeedFragment.TAG) != null) {
        outState.putString(KEY_FRAGMENT_TAG, LoadCurrentFeedFragment.TAG);
    }

    if (mActionMode != null) {
        mActionMode.finish();
    }
}
 
Example 6
Project: Aequorea   File: PhotoActivity.java   View Source Code Vote up 5 votes
private void startSaveImageDialogFragment() {
    SaveImageDialogFragment dialog = new SaveImageDialogFragment();
    Bundle bundle = new Bundle();
    bundle.putString(Constants.ARG_URL, mUrl);
    dialog.setArguments(bundle);

    dialog.show(getSupportFragmentManager(), null);
}
 
Example 7
Project: kognitivo   File: LikeActionController.java   View Source Code Vote up 5 votes
PublishLikeRequestWrapper(String objectId, LikeView.ObjectType objectType) {
    super(objectId, objectType);

    Bundle likeRequestParams = new Bundle();
    likeRequestParams.putString("object", objectId);

    setRequest(new GraphRequest(
            AccessToken.getCurrentAccessToken(),
            "me/og.likes",
            likeRequestParams,
            HttpMethod.POST));
}
 
Example 8
Project: android_nextgis_mobile   File: NGPreferenceActivity.java   View Source Code Vote up 5 votes
protected void onStartSubScreen(PreferenceScreen preferenceScreen)
{
    Bundle args = new Bundle();
    args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, preferenceScreen.getKey());
    args.putString(ConstantsUI.PREF_SCREEN_TITLE, preferenceScreen.getTitle().toString());
    replaceSettingsFragment(args);
}
 
Example 9
Project: amap   File: DownloadDialog.java   View Source Code Vote up 5 votes
public static DownloadDialog newInstance(String url) {
    DownloadDialog dialog = new DownloadDialog();
    Bundle bundle = new Bundle();
    bundle.putString(EXTRA_URL, url);
    dialog.setArguments(bundle);
    return dialog;
}
 
Example 10
Project: microMathematics   File: CustomImageView.java   View Source Code Vote up 5 votes
/**
 * Parcelable interface: procedure writes the formula state
 */
@Override
@SuppressLint("MissingSuperCall")
public Parcelable onSaveInstanceState()
{
    Bundle bundle = new Bundle();
    bundle.putString(STATE_IMAGE_TYPE, imageType.toString());
    switch (imageType)
    {
    case NONE:
        // nothing to do
        break;
    case BITMAP:
        if (bitmap != null)
        {
            bundle.putParcelable(STATE_IMAGE_BITMAP, bitmap);
        }
        break;
    case SVG:
        if (svgData != null)
        {
            bundle.putString(STATE_IMAGE_SVG, svgData);
        }
        break;
    }
    return bundle;
}
 
Example 11
Project: Veggietizer   File: InputActivity.java   View Source Code Vote up 5 votes
@Override
protected void onSaveInstanceState(Bundle outState) {
    TextView textViewDate = (TextView) findViewById(R.id.textview_date);

    super.onSaveInstanceState(outState);

    outState.putBoolean(KEY_INPUT_HELP_OPEN, isInputHelpPopupOpen);
    outState.putBoolean(KEY_MEAT_MODIFIED, isMeatModified);
    outState.putBoolean(KEY_SUBMIT_DATA_ENABLED, isSubmitDataEnabled);
    outState.putString(KEY_DATE, textViewDate.getText().toString());
    outState.putInt(KEY_WEIGHT, weightSelected);
}
 
Example 12
Project: minVideo   File: FileListFragment.java   View Source Code Vote up 5 votes
/**
 */
public static FileListFragment newInstance(String param1, String param2) {
    FileListFragment fragment = new FileListFragment();
    Bundle args = new Bundle();
    args.putString(ARG_PARAM1, param1);
    args.putString(ARG_PARAM2, param2);
    fragment.setArguments(args);
    return fragment;
}
 
Example 13
Project: AndroidCrossPromotion   File: MainActivity.java   View Source Code Vote up 5 votes
@Override
public void onSaveInstanceState(Bundle outState) {

    super.onSaveInstanceState(outState);

    outState.putBoolean("restore", true);
    outState.putString("mTitleText", mTitleText);
}
 
Example 14
Project: GCSApp   File: ImageDetailFragment.java   View Source Code Vote up 5 votes
public static ImageDetailFragment newInstance(String imageUrl) {
    final ImageDetailFragment f = new ImageDetailFragment();

    final Bundle args = new Bundle();
    args.putString("url", imageUrl);
    f.setArguments(args);

    return f;
}
 
Example 15
Project: Cam2Caption   File: Camera2BasicFragment.java   View Source Code Vote up 5 votes
public static ErrorDialog newInstance(String message) {
    ErrorDialog dialog = new ErrorDialog();
    Bundle args = new Bundle();
    args.putString(ARG_MESSAGE, message);
    dialog.setArguments(args);
    return dialog;
}
 
Example 16
Project: Runnest   File: SideBarActivity.java   View Source Code Vote up 5 votes
private void showMemoDialog(){
    DialogFragment dialog = new MemoDialogFragment();
    Bundle args = new Bundle();
    args.putSerializable("type", requestMessage.getChallengeType());
    args.putString("opponent", requestMessage.getFrom());
    args.putString("sender", requestMessage.getSender());
    args.putSerializable("date", requestMessage.getTime());
    args.putString("opponentEmail", requestMessage.getFrom());
    dialog.setArguments(args);
    dialog.show(getSupportFragmentManager(), "MemoDialogFragment");
}
 
Example 17
Project: BlackList   File: SMSConversationFragment.java   View Source Code Vote up 5 votes
void openSMSSendActivity(String person, String number, String body) {
    // put arguments for the SMS sending fragment
    Bundle arguments = new Bundle();
    arguments.putString(CONTACT_NAME, person);
    arguments.putString(CONTACT_NUMBER, number);
    arguments.putString(SMS_MESSAGE_BODY, body);
    // open activity with the fragment
    CustomFragmentActivity.show(getContext(),
            getString(R.string.New_message),
            SMSSendFragment.class, arguments);
}
 
Example 18
Project: simple-share-android   File: DirectoryFragment.java   View Source Code Vote up 4 votes
public boolean onPopupMenuItemClick(MenuItem item, int position) {
	final ArrayList<DocumentInfo> docs = new ArrayList<>();
	final Cursor cursor = mAdapter.getItem(position);
	final DocumentInfo doc = DocumentInfo.fromDirectoryCursor(cursor);
	docs.add(doc);

	final int id = item.getItemId();
	switch (id) {
	case R.id.menu_share:
		onShareDocuments(docs);
		return true;

	case R.id.menu_copy:
		moveDocument(docs, false);
		return true;

	case R.id.menu_cut:
		moveDocument(docs, true);
		return true;

	case R.id.menu_delete:
		deleteDocument(docs, id);
		return true;

	case R.id.menu_stop:
		stopDocument(docs, id);
		return true;

	case R.id.menu_save:
       case R.id.menu_uncompress:
       case R.id.menu_compress:
		new OperationTask(docs, id).execute();
		return true;
       case R.id.menu_open:
		openDocument(docs.get(0));
           return true;
       case R.id.menu_details:
           Intent intent2 = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:"
                   + AppsProvider.getPackageForDocId(docs.get(0).documentId)));
           if(Utils.isIntentAvailable(getActivity(), intent2)) {
               getActivity().startActivity(intent2);
           }
           Bundle params = new Bundle();
		String type = IconUtils.getTypeNameFromMimeType(docs.get(0).mimeType);
		params.putString(FILE_TYPE, type);
		AnalyticsManager.logEvent("details", params);
           return true;
	case R.id.menu_info:
		infoDocument(docs.get(0));
		return true;

	case R.id.menu_rename:
		renameDocument(docs.get(0));
		return true;

       case R.id.menu_bookmark:
		bookmarkDocument(docs.get(0));
           return true;
	default:
		return false;
	}
}
 
Example 19
Project: boohee_v5.6   File: WXEmojiObject.java   View Source Code Vote up 4 votes
public void serialize(Bundle bundle) {
    bundle.putByteArray("_wxemojiobject_emojiData", this.emojiData);
    bundle.putString("_wxemojiobject_emojiPath", this.emojiPath);
}
 
Example 20
Project: labtablet   File: ListFormFragment.java   View Source Code Vote up 4 votes
@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putString("items", new Gson().toJson(items));
    super.onSaveInstanceState(outState);
}