Bundle putCharSequence - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bundle putCharSequence method.

This code example shows how to use the following methods:putCharSequence, putSerializable
     * 
     * @param raw 
     * @param repo 
     */ 
    public void setText(final String raw, final IRepositoryIdProvider repo) {
        Bundle args = new Bundle();
        args.putCharSequence(ARG_TEXT, raw);
        if (repo instanceof Serializable)
            args.putSerializable(ARG_REPO, (Serializable) repo);
        getLoaderManager().restartLoader(0, args, this);
        Keyboard.hideSoftInput(bodyText);
        showLoading(true); 
    } 
 
    private void showLoading(final boolean loading) {
        ViewUtils.setGone(progress, !loading);
        ViewUtils.setGone(bodyText, loading);
    } 
 
    @Override 
9
CodeRank
This code example shows how to use the following methods:putCharSequence
         * Create a new instance of MyFragment that will be initialized 
         * with the given arguments. 
         */ 
        static MyFragment newInstance(CharSequence label) {
            MyFragment f = new MyFragment();
            Bundle b = new Bundle();
            b.putCharSequence("label", label);
            f.setArguments(b);
            return f;
        } 
 
        /** 
         * Parse attributes during inflation from a view hierarchy into the 
         * arguments we handle. 
         */ 
        @Override public void onInflate(Activity activity, AttributeSet attrs,
                Bundle savedInstanceState) {
            super.onInflate(activity, attrs, savedInstanceState);
 
            TypedArray a = activity.obtainStyledAttributes(attrs,
8
CodeRank
This code example shows how to use the following methods:putBoolean, putCharSequence
 
    @Override 
    public void onSaveInstanceState(Bundle state) {
        super.onSaveInstanceState(state);
 
        Bundle dialogState = new Bundle();
        dialogState.putCharSequence(STATE_NUMBER, mEditText.getText());
        dialogState.putBoolean(STATE_PHONE, mBlockCalls.isChecked());
        dialogState.putBoolean(STATE_MESSAGE, mBlockMessages.isChecked());
        state.putBundle(DIALOG_STATE, dialogState);
    } 
 
    @Override 
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    } 
 
    @Override 
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
    } 
 
8
CodeRank
This code example shows how to use the following methods:putCharSequence, putInt
  private EditText editor=null;
 
  static EditorFragment newInstance(int position,
                                    CharSequence text) {
    EditorFragment frag=new EditorFragment();
    Bundle args=new Bundle();
 
    args.putInt(KEY_POSITION, position);
    args.putCharSequence(KEY_TEXT, text);
    frag.setArguments(args);
 
    return(frag);
  } 
 
  @Override 
  public View onCreateView(LayoutInflater inflater,
                           ViewGroup container,
                           Bundle savedInstanceState) {
    View result=inflater.inflate(R.layout.editor, container, false);
     
8
CodeRank
This code example shows how to use the following methods:putCharSequence, putInt
    @Override 
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
         
        // Save the clear dialog's info 
        outState.putCharSequence(CLEAR_DIALOG_BOOKMARK_TITLE, mClearDialogBookmarkTitle);
        outState.putInt(CLEAR_DIALOG_SHORTCUT, mClearDialogShortcut);
    } 
 
    @Override 
    protected Dialog onCreateDialog(int id) {
        switch (id) {
             
            case DIALOG_CLEAR_SHORTCUT: {
                // Create the dialog for clearing a shortcut 
                return new AlertDialog.Builder(this)
                        .setTitle(getString(R.string.quick_launch_clear_dialog_title))
                        .setIconAttribute(android.R.attr.alertDialogIcon)
                        .setMessage(getString(R.string.quick_launch_clear_dialog_message,
                                mClearDialogShortcut, mClearDialogBookmarkTitle))
7
CodeRank
This code example shows how to use the following methods:putCharSequence
         * Create a new instance of MyFragment that will be initialized 
         * with the given arguments. 
         */ 
        static MyFragment newInstance(CharSequence label) {
            MyFragment f = new MyFragment();
            Bundle b = new Bundle();
            b.putCharSequence("label", label);
            f.setArguments(b);
            return f;
        } 
 
        /** 
         * Parse attributes during inflation from a view hierarchy into the 
         * arguments we handle. 
         */ 
        @Override public void onInflate(Activity activity, AttributeSet attrs,
                Bundle savedInstanceState) {
            super.onInflate(activity, attrs, savedInstanceState);
 
            TypedArray a = activity.obtainStyledAttributes(attrs,
7
CodeRank
This code example shows how to use the following methods:putCharSequence
    return extras.getStringArray(name);
  } 
 
  @Implementation 
  public Intent putExtra(String key, CharSequence value) {
    extras.putCharSequence(key, value);
    return realIntent;
  } 
 
  @Implementation 
  public CharSequence getCharSequenceExtra(String name) {
    return extras.getCharSequence(name);
  } 
 
  @Implementation 
  public void putExtra(String key, byte[] value) {
    extras.putByteArray(key, value);
  } 
 
  @Implementation 
6
CodeRank
This code example shows how to use the following methods:putCharSequence, putInt
        } 
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt(CODE, mCodeView.getSelectedItemPosition());
        outState.putCharSequence(USER_COMMENT, mUserComment.getText());
    } 
 
    @Override 
    protected void sendReport() { 
        // Hide the soft keyboard. 
        InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(
                Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(mUserComment.getWindowToken(), 0);
        super.sendReport(); 
    } 
 
    private static final String[] SPINNER_TO_CODE = new String[] {
7
CodeRank
This code example shows how to use the following methods:putCharSequence, remove
     */ 
    public Request put(String name, CharSequence value) {
        removeFromRequestData(name);
        mParamList.add(name);
        mTypeList.add(TYPE_CHARSEQUENCE);
        mBundle.putCharSequence(name, value);
        return this;
    } 
 
    /** 
     * Add a Parcelable parameter to the request, replacing any existing value for the given name. 
     * 
     * @param name The parameter name. 
     * @param value The parameter value. 
     * @return This RequestData. 
     */ 
    public Request put(String name, Parcelable value) {
        removeFromRequestData(name);
        mParamList.add(name);
        mTypeList.add(TYPE_PARCELABLE);

6
CodeRank
This code example shows how to use the following methods:putCharSequence
        return extras.getStringArray(name);
    } 
 
    @Implementation 
    public Intent putExtra(String key, CharSequence value) {
        extras.putCharSequence(key, value);
        return realIntent;
    } 
 
    @Implementation 
    public CharSequence getCharSequenceExtra(String name) {
        return extras.getCharSequence(name);
    } 
 
    @Implementation 
    public void putExtra(String key, byte[] value) {
        extras.putByteArray(key, value);
    } 
 
    @Implementation 
6
CodeRank

Related Bundle putCharSequence Questions & Answers:

putCharSequence Method Overview
Inserts a CharSequence value into the mapping of this Bundle, replacing any existing value for the given key.
See Code Examples for other Android Bundle Methods: