本文整理汇总了Java中android.os.Bundle.putBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putBoolean方法的具体用法?Java Bundle.putBoolean怎么用?Java Bundle.putBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.putBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setEditText
import android.os.Bundle; //导入方法依赖的package包/类
public void setEditText(@NonNull Context context, @NonNull String text) throws MyException {
if (null == context) {
throw new NullPointerException("context");
}
if (null == text) {
throw new NullPointerException("text");
}
try {
//清空内容
Bundle arguments = new Bundle();
arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfo
.MOVEMENT_GRANULARITY_LINE);
arguments.putBoolean(AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, true);
mAccessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY,
arguments);
//粘贴内容
ClipData clipData = ClipData.newPlainText(context.getPackageName(), text);
ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
clipboardManager.setPrimaryClip(clipData);
mAccessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_PASTE);
} catch (Exception e) {
throw new MyException(e);
}
}
示例2: getIntentAndInitFragment
import android.os.Bundle; //导入方法依赖的package包/类
private void getIntentAndInitFragment() {
Intent intent = getIntent();
mDefaultCount = intent.getIntExtra(EXTRA_SELECT_COUNT, 6);
int mode = intent.getIntExtra(EXTRA_SELECT_MODE, MODE_MULTI);
boolean isShow = intent.getBooleanExtra(EXTRA_SHOW_CAMERA, true);
if (mode == MODE_MULTI && intent.hasExtra(EXTRA_DEFAULT_SELECTED_LIST)) {
resultList = intent.getStringArrayListExtra(EXTRA_DEFAULT_SELECTED_LIST);
}
Bundle bundle = new Bundle();
bundle.putInt(ImageSelectorFragment.EXTRA_SELECT_COUNT, mDefaultCount);
bundle.putInt(ImageSelectorFragment.EXTRA_SELECT_MODE, mode);
bundle.putBoolean(ImageSelectorFragment.EXTRA_SHOW_CAMERA, isShow);
bundle.putStringArrayList(ImageSelectorFragment.EXTRA_DEFAULT_SELECTED_LIST, resultList);
getSupportFragmentManager().beginTransaction()
.add(R.id.kf5_image_framelayout, Fragment.instantiate(this, ImageSelectorFragment.class.getName(), bundle))
.commit();
initView();
}
示例3: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle bundle) {
bundle.putInt("InputKeyRefClipboard.InputPadIdx", minputKeyRefClipboard.mnInputPadIdx);
bundle.putBoolean("InputKeyRefClipboard.IsLand", minputKeyRefClipboard.mbIsLand);
bundle.putInt("InputKeyRefClipboard.InputKeyIdx", minputKeyRefClipboard.mnInputKeyIdx);
bundle.putString("ClipboardMode", mstrClipboardMode);
bundle.putInt("SelectedInputPadIdx", mnSelectedInputPadIdx);
bundle.putString("OriginallyLoadedInputPadsCfg", mstrOriginallyLoadedInputPadsCfg);
bundle.putInt("DialogState", mnDialogState);
bundle.putString("CannotSaveError", mstrCannotSaveError);
bundle.putBoolean("CfgFileChanged", mbCfgFileChanged);
String strXML = InputPadMgrEx.writeInputPadsToXML(mlistInputPads);
bundle.putString("InputPads", strXML);
// super.onSaveInstanceState(bundle);
}
示例4: getItem
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public Fragment getItem(int position) {
GuideFragment fragment = new GuideFragment();
Bundle arguments = fragment.getArguments();
arguments.putString(GuideFragment.MESSAGE, mMessages[position]);
arguments.putString(GuideFragment.MESSAGE2, mMessages2[position]);
if (mTitles[position].equals(mTitleShowButton)) {
arguments.putBoolean(GuideFragment.BUTTON, true);
} else {
arguments.putBoolean(GuideFragment.BUTTON, false);
}
return fragment;
}
示例5: generateConditionBundle
import android.os.Bundle; //导入方法依赖的package包/类
public static Bundle generateConditionBundle(final Context context,
final int pin, final boolean output) {
Bundle result = new Bundle();
result.putInt(CONDITION_BUNDLE_EXTRA_PIN_NUMBER, pin);
result.putBoolean(CONDITION_BUNDLE_EXTRA_OUTPUT, output);
return result;
}
示例6: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public Parcelable onSaveInstanceState() {
Bundle bundle = new Bundle();
bundle.putParcelable("instanceState", super.onSaveInstanceState());
bundle.putFloat("saveScale", normalizedScale);
bundle.putFloat("matchViewHeight", matchViewHeight);
bundle.putFloat("matchViewWidth", matchViewWidth);
bundle.putInt("viewWidth", viewWidth);
bundle.putInt("viewHeight", viewHeight);
matrix.getValues(m);
bundle.putFloatArray("matrix", m);
bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
return bundle;
}
示例7: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Creates a new instance of this fragment.
*
* @param triggerDataSyncOnCreate Allows disabling the background sync service onCreate. Should
* only be set to false during testing.
* @return The new instance
*/
@NonNull
public static HomeworkFragment newInstance(boolean triggerDataSyncOnCreate) {
HomeworkFragment homeworkFragment = new HomeworkFragment();
Bundle args = new Bundle();
args.putBoolean(ARGUMENT_TRIGGER_SYNC, triggerDataSyncOnCreate);
homeworkFragment.setArguments(args);
return homeworkFragment;
}
示例8: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
public static ContainerFragment newInstance(int value, boolean customAnim) {
Bundle args = new Bundle();
args.putInt(BUNDLE_KEY, value);
args.putBoolean(BUNDLE_KEY + 1, customAnim);
ContainerFragment fragment = new ContainerFragment();
fragment.setArguments(args);
return fragment;
}
示例9: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState)
{
if (currEntry != null)
{
outState.putInt(YEAR, currEntry.get(Calendar.YEAR));
outState.putInt(MONTH, currEntry.get(Calendar.MONTH));
outState.putInt(DAY, currEntry.get(Calendar.DATE));
outState.putBoolean(SHOWN, shown);
}
super.onSaveInstanceState(outState);
}
示例10: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putLong(ChatSDKBaseThreadActivity.THREAD_ID, threadID);
outState.putInt(MODE, mode);
outState.putBoolean(ChatSDKAbstractChatActivity.ANIMATE_EXIT, animateExit);
}
示例11: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
public static HomeFragment newInstance(boolean loggedIn, boolean farming) {
final HomeFragment fragment = new HomeFragment();
final Bundle args = new Bundle();
args.putBoolean(LOGGED_IN, loggedIn);
args.putBoolean(FARMING, farming);
fragment.setArguments(args);
return fragment;
}
示例12: onResume
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onResume() {
super.onResume();
Bundle args = getArguments();
boolean notShown = !args.getBoolean("isShown", false);
if (action != null && notShown) {
String campaignId = args.getString(CAMPAIGN_ID);
long timestamp = System.currentTimeMillis();
action.execute(campaignId, timestamp);
args.putBoolean("isShown", true);
}
}
示例13: startEditProfileActivity
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void startEditProfileActivity(Usuario usuario) {
Bundle bundle = new Bundle();
bundle.putBoolean(Constants._FIRST_TIME, true);
bundle.putParcelable(EXTRA_USER, usuario);
IntentUtils.startActivity(this, bundle, EditProfileActivity.class);
this.finish(); //Removing from list of activities
}
示例14: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
protected void onSaveInstanceState(Bundle outState) {
//被摧毁前缓存一些数据
outState.putString("uid",uid);
outState.putString("companyId",companyId);
outState.putInt("flag_exit_type",flag_exit_type);
outState.putBoolean("flag_exit_sdk",flag_exit_sdk);
outState.putString("msgTmp",msgTmp);
outState.putString("msgTxt",msgTxt);
super.onSaveInstanceState(outState);
}
示例15: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putSerializable("calendar", myCalendar);
outState.putBoolean("hasReminder", hasReminder);
}