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

The following are Jave code examples for showing how to use putCharSequence() 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: KakaoBot   File: KakaoTalkListener.java   View Source Code Vote up 6 votes
public static void send(String room, String message) throws IllegalArgumentException { // @author ManDongI
    Notification.Action session = null;

    for(Session i : sessions) {
        if(i.room.equals(room)) {
            session = i.session;

            break;
        }
    }

    if(session == null) {
        throw new IllegalArgumentException("Can't find the room");
    }

    Intent sendIntent = new Intent();
    Bundle msg = new Bundle();
    for (RemoteInput inputable : session.getRemoteInputs()) msg.putCharSequence(inputable.getResultKey(), message);
    RemoteInput.addResultsToIntent(session.getRemoteInputs(), sendIntent, msg);

    try {
        session.actionIntent.send(context, 0, sendIntent);
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
Example 2
Project: boohee_v5.6   File: RemoteInputCompatJellybean.java   View Source Code Vote up 6 votes
static void addResultsToIntent(RemoteInput[] remoteInputs, Intent intent, Bundle results) {
    Bundle resultsBundle = new Bundle();
    for (RemoteInput remoteInput : remoteInputs) {
        Object result = results.get(remoteInput.getResultKey());
        if (result instanceof CharSequence) {
            resultsBundle.putCharSequence(remoteInput.getResultKey(), (CharSequence) result);
        }
    }
    Intent clipIntent = new Intent();
    clipIntent.putExtra("android.remoteinput.resultsData", resultsBundle);
    intent.setClipData(ClipData.newIntent("android.remoteinput.results", clipIntent));
}
 
Example 3
Project: boohee_v5.6   File: NotificationCompat.java   View Source Code Vote up 6 votes
public Builder extend(Builder builder) {
    Bundle wearableBundle = new Bundle();
    if (this.mFlags != 1) {
        wearableBundle.putInt(KEY_FLAGS, this.mFlags);
    }
    if (this.mInProgressLabel != null) {
        wearableBundle.putCharSequence(KEY_IN_PROGRESS_LABEL, this.mInProgressLabel);
    }
    if (this.mConfirmLabel != null) {
        wearableBundle.putCharSequence(KEY_CONFIRM_LABEL, this.mConfirmLabel);
    }
    if (this.mCancelLabel != null) {
        wearableBundle.putCharSequence(KEY_CANCEL_LABEL, this.mCancelLabel);
    }
    builder.getExtras().putBundle(EXTRA_WEARABLE_EXTENSIONS, wearableBundle);
    return builder;
}
 
Example 4
Project: ReplyMessage   File: AutoReplyService.java   View Source Code Vote up 6 votes
private boolean findEditTextSend(AccessibilityNodeInfo rootNode, String edit,String content) {
    Log.e(TAG, "findEditTextSend: rootNode"+rootNode.toString() );
    List<AccessibilityNodeInfo> editInfo = rootNode.findAccessibilityNodeInfosByViewId(edit);

    if(editInfo!=null&&!editInfo.isEmpty()){
        Bundle arguments = new Bundle();
        arguments.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, content);
        editInfo.get(0).performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments);
        Log.e("xiaoxin", "findEditTextSend: true");
        return true;
    }else {
        Log.e("xiaoxin", "findEditTextSend: null");
    }
    Log.e("xiaoxin", "findEditTextSend: false"+editInfo.isEmpty() );
    return false;
}
 
Example 5
Project: WeChatLuckyMoney   File: HongbaoService.java   View Source Code Vote up 6 votes
private void sendComment() {
    try {
        AccessibilityNodeInfo outNode =
                getRootInActiveWindow().getChild(0).getChild(0);
        AccessibilityNodeInfo nodeToInput = outNode.getChild(outNode.getChildCount() - 1).getChild(0).getChild(1);

        if ("android.widget.EditText".equals(nodeToInput.getClassName())) {
            Bundle arguments = new Bundle();
            arguments.putCharSequence(AccessibilityNodeInfo
                    .ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, signature.commentString);
            nodeToInput.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments);
        }
    } catch (Exception e) {
        // Not supported
    }
}
 
Example 6
Project: NewKakaoBot   File: KakaoTalkListener.java   View Source Code Vote up 6 votes
public static void send(String room, String message) throws IllegalArgumentException { // @author ManDongI
    Notification.Action session = null;

    for(KakaoData data : KakaoManager.getInstance().getDataList().toArray(new KakaoData[0])) {
        if(data.room.equals(room)) {
            session = data.session;

            break;
        }
    }

    if(session == null) {
        throw new IllegalArgumentException("Can't find the room");
    }

    Intent sendIntent = new Intent();
    Bundle msg = new Bundle();
    for (RemoteInput inputable : session.getRemoteInputs()) msg.putCharSequence(inputable.getResultKey(), message);
    RemoteInput.addResultsToIntent(session.getRemoteInputs(), sendIntent, msg);

    try {
        session.actionIntent.send(context, 0, sendIntent);

        Logger.Log log = new Logger.Log();
        log.type = Logger.Type.APP;
        log.title = "send message";
        log.index = "room: " + room +"\nmessage: " + message;

        Logger.getInstance().add(log);
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
Example 7
Project: KernelAdiutor-Mod   File: DescriptionFragment.java   View Source Code Vote up 5 votes
public static DescriptionFragment newInstance(CharSequence title, CharSequence summary) {
    Bundle args = new Bundle();
    DescriptionFragment fragment = new DescriptionFragment();
    args.putCharSequence("title", title);
    args.putCharSequence("summary", summary);
    fragment.setArguments(args);
    return fragment;
}
 
Example 8
Project: microMathematics   File: MainActivity.java   View Source Code Vote up 5 votes
/*********************************************************
 * Instance state
 *********************************************************/

@Override
protected void onSaveInstanceState(Bundle outState)
{
    if (storedFormula != null)
    {
        outState.putParcelable(STATE_STORED_FORMULA, storedFormula.onSaveInstanceState());
    }
    if (getWorksheetName() != null)
    {
        outState.putCharSequence(STATE_WORKSHEET_NAME, getWorksheetName());
    }
    super.onSaveInstanceState(outState);
}
 
Example 9
Project: permitlog-android   File: MainActivity.java   View Source Code Vote up 5 votes
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    // Save action bar title and menuArgs during an orientation change:
    outState.putCharSequence("title", getSupportActionBar().getTitle());
    outState.putParcelableArray("menuArgs", menuArgs);
}
 
Example 10
Project: android_ui   File: TextFragment.java   View Source Code Vote up 5 votes
@NonNull
public static TextFragment newInstance(@Nullable CharSequence text) {
	final TextFragment fragment = new TextFragment();
	final Bundle args = new Bundle();
	args.putCharSequence(Extras.EXTRA_TEXT, text);
	fragment.setArguments(args);
	return fragment;
}
 
Example 11
Project: BuddyBook   File: MainActivity.java   View Source Code Vote up 5 votes
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelable(KEY_PARCELABLE_USER, mUser);
    outState.putString(KEY_FOLDER_ID,mFolderId);

    if (mSearchView != null && mSearchView.isEnabled()) {
        outState.putCharSequence(KEY_CURRENT_QUERY, mSearchView.getQuery().toString());
        outState.putBoolean(KEY_FLAG_SEARCH_OPEN, mSearchView.isShown());

    }
}
 
Example 12
Project: CSipSimple   File: DialerFragment.java   View Source Code Vote up 5 votes
@Override
public void onVisibilityChanged(boolean visible) {
    if (visible && getResources().getBoolean(R.bool.use_dual_panes)) {
        // That's far to be optimal we should consider uncomment tests for reusing fragment
        // if (autoCompleteFragment == null) {
        autoCompleteFragment = new DialerAutocompleteDetailsFragment();

        if (digits != null) {
            Bundle bundle = new Bundle();
            bundle.putCharSequence(DialerAutocompleteDetailsFragment.EXTRA_FILTER_CONSTRAINT,
                    digits.getText().toString());

            autoCompleteFragment.setArguments(bundle);

        }
        // }
        // if
        // (getFragmentManager().findFragmentByTag(TAG_AUTOCOMPLETE_SIDE_FRAG)
        // != autoCompleteFragment) {
        // Execute a transaction, replacing any existing fragment
        // with this one inside the frame.
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.replace(R.id.details, autoCompleteFragment, TAG_AUTOCOMPLETE_SIDE_FRAG);
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
        ft.commitAllowingStateLoss();
    
        // }
    }
}
 
Example 13
Project: Task-Reminder   File: ReminderAddActivity.java   View Source Code Vote up 5 votes
@Override
protected void onSaveInstanceState (Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putCharSequence(KEY_TITLE, mTitleText.getText());
    outState.putCharSequence(KEY_DESC, mTitleDesc.getText());
    outState.putCharSequence(KEY_TIME, mTimeText.getText());
    outState.putCharSequence(KEY_DATE, mDateText.getText());
    outState.putCharSequence(KEY_REPEAT, mRepeatText.getText());
    outState.putCharSequence(KEY_REPEAT_NO, mRepeatNoText.getText());
    outState.putCharSequence(KEY_REPEAT_TYPE, mRepeatTypeText.getText());
    outState.putCharSequence(KEY_ACTIVE, mActive);
}
 
Example 14
Project: okwallet   File: ExtendedPublicKeyFragment.java   View Source Code Vote up 5 votes
private static ExtendedPublicKeyFragment instance(final CharSequence xpub) {
    final ExtendedPublicKeyFragment fragment = new ExtendedPublicKeyFragment();

    final Bundle args = new Bundle();
    args.putCharSequence(KEY_XPUB, xpub);
    fragment.setArguments(args);

    return fragment;
}
 
Example 15
Project: android-state   File: InjectionHelper.java   View Source Code Vote up 4 votes
public void putCharSequence(Bundle state, String key, CharSequence x) {
    state.putCharSequence(key + mBaseKey, x);
}
 
Example 16
Project: KernelAdiutor-Mod   File: EditorActivity.java   View Source Code Vote up 4 votes
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putCharSequence(EDITTEXT_INTENT, mEditText.getText());
}
 
Example 17
Project: weixin_auto   File: AutoUtil.java   View Source Code Vote up 4 votes
public static Bundle createBuddleText(String inputText){
    Bundle inputContent = new Bundle();
    inputContent.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE,inputText);
    return inputContent;
}
 
Example 18
Project: AndiCar   File: CommonDetailActivity.java   View Source Code Vote up 4 votes
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putCharSequence("Title", getTitle());
}
 
Example 19
Project: IPCInvoker   File: ParameterHelper.java   View Source Code Vote up 4 votes
public static void put(Bundle bundle, String key, Object value) {
        if (value instanceof Integer) {
            bundle.putInt(key, (Integer) value);
        } else if (value instanceof Float) {
            bundle.putFloat(key, (Float) value);
        } else if (value instanceof Character) {
            bundle.putChar(key, (Character) value);
        } else if (value instanceof CharSequence) {
            bundle.putCharSequence(key, (CharSequence) value);
        } else if (value instanceof Long) {
            bundle.putLong(key, (Long) value);
        } else if (value instanceof Short) {
            bundle.putShort(key, (Short) value);
        } else if (value instanceof Byte) {
            bundle.putByte(key, (Byte) value);
        } else if (value instanceof Boolean) {
            bundle.putBoolean(key, (Boolean) value);
        } else if (value instanceof Double) {
            bundle.putDouble(key, (Double) value);
        } else if (value instanceof Parcelable) {
            bundle.putParcelable(key, (Parcelable) value);
        } else if (value instanceof Bundle) {
            bundle.putBundle(key, (Bundle) value);
        } else if (value instanceof int[]) {
            bundle.putIntArray(key, (int[]) value);
        } else if (value instanceof byte[]) {
            bundle.putByteArray(key, (byte[]) value);
        } else if (value instanceof float[]) {
            bundle.putFloatArray(key, (float[]) value);
        } else if (value instanceof double[]) {
            bundle.putDoubleArray(key, (double[]) value);
        } else if (value instanceof boolean[]) {
            bundle.putBooleanArray(key, (boolean[]) value);
        } else if (value instanceof long[]) {
            bundle.putLongArray(key, (long[]) value);
        } else if (value instanceof Parcelable[]) {
            bundle.putParcelableArray(key, (Parcelable[]) value);
        } else if (value instanceof short[]) {
            bundle.putShortArray(key, (short[]) value);
        } else if (value instanceof String[]) {
            bundle.putStringArray(key, (String[]) value);
        } else {
//            bundle.putString(key, String.valueOf(value));
        }
    }
 
Example 20
Project: Lyra   File: CharSequenceCoder.java   View Source Code Vote up 2 votes
/**
 * Write a field's value into the saved state {@link Bundle}.
 *
 * @param state      {@link Bundle} used to save the state
 * @param key        key retrieved from {@code fieldDeclaringClass#fieldName}
 * @param fieldValue value of field
 */
@Override
public void serialize(@NonNull Bundle state, @NonNull String key, @NonNull CharSequence fieldValue) {
    state.putCharSequence(key, fieldValue);
}