android.os.Bundle.putCharSequence()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(388)

本文整理了Java中android.os.Bundle.putCharSequence()方法的一些代码示例,展示了Bundle.putCharSequence()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.putCharSequence()方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:putCharSequence

Bundle.putCharSequence介绍

暂无

代码示例

代码示例来源:origin: androidannotations/androidannotations

public I arg(String key, CharSequence value) {
  args.putCharSequence(key, value);
  return (I) this;
}

代码示例来源:origin: konmik/nucleus

when(bundle.getFloat(anyString(), anyFloat())).thenAnswer(getOrDefault);
doAnswer(put).when(bundle).putCharSequence(anyString(), any(CharSequence.class));
when(bundle.getCharSequence(anyString())).thenAnswer(get);
when(bundle.getCharSequence(anyString(), any(CharSequence.class))).thenAnswer(getOrDefault);

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * Inserts a CharSequence value into the mapping of this Bundle, replacing
 * any existing value for the given key.  Either key or value may be null.
 *
 * @param key   a String, or null
 * @param value a CharSequence, or null
 */
public Bundler putCharSequence(String key, CharSequence value) {
 bundle.putCharSequence(key, value);
 return this;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * Inserts a CharSequence value into the mapping of this Bundle, replacing
 * any existing value for the given key.  Either key or value may be null.
 *
 * @param key   a String, or null
 * @param value a CharSequence, or null
 */
public Bundler putCharSequence(String key, CharSequence value) {
 bundle.putCharSequence(key, value);
 return this;
}

代码示例来源:origin: bluelinelabs/Conductor

public BundleBuilder putCharSequence(String key, CharSequence value) {
  bundle.putCharSequence(key, value);
  return this;
}

代码示例来源:origin: f2prateek/dart

/**
 * Inserts a CharSequence value into the mapping of the underlying Bundle, replacing any existing
 * value for the given key. Either key or value may be null.
 *
 * @param key a String, or null
 * @param value a CharSequence, or null
 * @return this bundler instance to chain method calls
 */
public Bundler put(String key, CharSequence value) {
 delegate.putCharSequence(key, value);
 return this;
}

代码示例来源:origin: aporter/coursera-android

@Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putCharSequence(MTEXTVIEW_TEXT_KEY,mTextView.getText());
  }
}

代码示例来源:origin: aporter/coursera-android

@Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putCharSequence(MTEXTVIEW_TEXT_KEY,mTextView.getText());
  }
}

代码示例来源:origin: stackoverflow.com

private TextView mTextView;
private static final String KEY_TEXT_VALUE = "textValue";

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  mTextView = (TextView) findViewById(R.id.main);
  if (savedInstanceState != null) {
   CharSequence savedText = savedInstanceState.getCharSequence(KEY_TEXT_VALUE);
   mTextView.setText(savedText);
  }
}

@Override
protected void onSaveInstanceState (Bundle outState) {
  super.onSaveInstanceState(outState);
  outState.putCharSequence(KEY_TEXT_VALUE, mTextView.getText());
}

代码示例来源:origin: commonsguy/cw-omnibus

static EditorFragment newInstance(String title, CharSequence text) {
 EditorFragment frag=new EditorFragment();
 Bundle args=new Bundle();
 args.putString(KEY_TITLE, title);
 args.putCharSequence(KEY_TEXT, text);
 frag.setArguments(args);
 return(frag);
}

代码示例来源:origin: facebook/facebook-android-sdk

params.putCharSequence(
    Constants.IAP_PRODUCT_ID,
    purchaseJSON.getString("productId"));
params.putCharSequence(
    Constants.IAP_PURCHASE_TIME,
    purchaseJSON.getString("purchaseTime"));
params.putCharSequence(
    Constants.IAP_PURCHASE_TOKEN,
    purchaseJSON.getString("purchaseToken"));
params.putCharSequence(
    Constants.IAP_PACKAGE_NAME,
    purchaseJSON.optString("packageName"));
params.putCharSequence(
    Constants.IAP_PRODUCT_TITLE,
    skuDetailsJSON.optString("title"));
params.putCharSequence(
    Constants.IAP_PRODUCT_DESCRIPTION,
    skuDetailsJSON.optString("description"));
params.putCharSequence(
    Constants.IAP_PRODUCT_TYPE,
    type);
if (type.equals("subs")) {
  params.putCharSequence(
      Constants.IAP_SUBSCRIPTION_AUTORENEWING,
      Boolean.toString(purchaseJSON.optBoolean("autoRenewing",
          false)));
  params.putCharSequence(
      Constants.IAP_SUBSCRIPTION_PERIOD,

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onSaveInstanceState(Bundle state) {
 super.onSaveInstanceState(state);
 if (!sv.isIconified()) {
  state.putCharSequence(STATE_QUERY, sv.getQuery());
 }
 state.putStringArrayList(STATE_MODEL, words);
}

代码示例来源:origin: stackoverflow.com

state.putCharSequence(App.VSTUP, vstup.getText());
return state;

代码示例来源:origin: facebook/facebook-android-sdk

public static void logActivityTimeSpentEvent(String activityName, long timeSpentInSeconds) {
  final Context context = FacebookSdk.getApplicationContext();
  final String appId = FacebookSdk.getApplicationId();
  Validate.notNull(context, "context");
  final FetchedAppSettings settings = FetchedAppSettingsManager.queryAppSettings(
      appId, false);
  if (settings != null
      && settings.getAutomaticLoggingEnabled()
      && timeSpentInSeconds > 0) {
    AppEventsLogger appEventsLogger = AppEventsLogger.newLogger(context);
    Bundle params = new Bundle(1);
    params.putCharSequence(Constants.AA_TIME_SPENT_SCREEN_PARAMETER_NAME, activityName);
    appEventsLogger.logEvent(
        Constants.AA_TIME_SPENT_EVENT_NAME, timeSpentInSeconds, params);
  }
}

代码示例来源:origin: robolectric/robolectric

@Test
@Config(minSdk = JELLY_BEAN_MR2)
public void testGetApplicationRestrictions() {
 String packageName = context.getPackageName();
 assertThat(userManager.getApplicationRestrictions(packageName).size()).isEqualTo(0);
 Bundle restrictions = new Bundle();
 restrictions.putCharSequence("test_key", "test_value");
 shadowOf(userManager).setApplicationRestrictions(packageName, restrictions);
 assertThat(
     userManager
       .getApplicationRestrictions(packageName)
       .getCharSequence("test_key")
       .toString())
   .isEqualTo("test_value");
}

代码示例来源:origin: robolectric/robolectric

@Test
public void getApplicationRestrictions() {
 assertThat(restrictionsManager.getApplicationRestrictions()).isNull();
 Bundle bundle = new Bundle();
 bundle.putCharSequence("test_key", "test_value");
 shadowOf(restrictionsManager).setApplicationRestrictions(bundle);
 assertThat(restrictionsManager.getApplicationRestrictions().getCharSequence("test_key")).isEqualTo("test_value");
}

代码示例来源:origin: meituan/WMRouter

/**
 * 附加到Intent的Extra
 */
public DefaultUriRequest putExtra(String name, CharSequence value) {
  extra().putCharSequence(name, value);
  return this;
}

代码示例来源:origin: limedroid/XDroidMvp

public Router putCharSequence(@Nullable String key, @Nullable CharSequence value) {
  getBundleData().putCharSequence(key, value);
  return this;
}

代码示例来源:origin: heinrichreimer/material-intro

public static SimpleSlideFragment newInstance(long id, CharSequence title, @StringRes int titleRes,
                       CharSequence description, @StringRes int descriptionRes,
                       @DrawableRes int imageRes, @ColorRes int backgroundRes,
                       @LayoutRes int layout, int permissionsRequestCode) {
  Bundle arguments = new Bundle();
  arguments.putLong(ARGUMENT_ID, id);
  arguments.putCharSequence(ARGUMENT_TITLE, title);
  arguments.putInt(ARGUMENT_TITLE_RES, titleRes);
  arguments.putCharSequence(ARGUMENT_DESCRIPTION, description);
  arguments.putInt(ARGUMENT_DESCRIPTION_RES, descriptionRes);
  arguments.putInt(ARGUMENT_IMAGE_RES, imageRes);
  arguments.putInt(ARGUMENT_BACKGROUND_RES, backgroundRes);
  arguments.putInt(ARGUMENT_LAYOUT_RES, layout);
  arguments.putInt(ARGUMENT_PERMISSIONS_REQUEST_CODE, permissionsRequestCode);
  SimpleSlideFragment fragment = new SimpleSlideFragment();
  fragment.setArguments(arguments);
  return fragment;
}

代码示例来源:origin: stackoverflow.com

public class PageFragment extends Fragment {
  private final static String PAGE_TEXT = "PAGE_TEXT";

  public static PageFragment newInstance(CharSequence pageText) {
    PageFragment frag = new PageFragment();
    Bundle args = new Bundle();
    args.putCharSequence(PAGE_TEXT, pageText);
    frag.setArguments(args);
    return frag;
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    CharSequence text = getArguments().getCharSequence(PAGE_TEXT);
    TextView pageView = (TextView) inflater.inflate(R.layout.page, container, false);
    pageView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.text_size));
    pageView.setText(text);
    return pageView;
  }
}

相关文章

Bundle类方法