本文整理汇总了Java中android.os.Bundle.putCharSequence方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putCharSequence方法的具体用法?Java Bundle.putCharSequence怎么用?Java Bundle.putCharSequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.putCharSequence方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import android.os.Bundle; //导入方法依赖的package包/类
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();
}
}
示例2: addResultsToIntent
import android.os.Bundle; //导入方法依赖的package包/类
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));
}
示例3: extend
import android.os.Bundle; //导入方法依赖的package包/类
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;
}
示例4: findEditTextSend
import android.os.Bundle; //导入方法依赖的package包/类
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;
}
示例5: sendComment
import android.os.Bundle; //导入方法依赖的package包/类
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
}
}
示例6: send
import android.os.Bundle; //导入方法依赖的package包/类
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();
}
}
示例7: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
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;
}
示例8: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
/*********************************************************
* 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);
}
示例9: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@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);
}
示例10: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
@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;
}
示例11: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@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());
}
}
示例12: onVisibilityChanged
import android.os.Bundle; //导入方法依赖的package包/类
@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();
// }
}
}
示例13: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@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);
}
示例14: instance
import android.os.Bundle; //导入方法依赖的package包/类
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;
}
示例15: putCharSequence
import android.os.Bundle; //导入方法依赖的package包/类
public void putCharSequence(Bundle state, String key, CharSequence x) {
state.putCharSequence(key + mBaseKey, x);
}