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

The following are Jave code examples for showing how to use getBoolean() 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: android_nextgis_mobile   File: LocalResourceSelectDialog.java   View Source Code Vote up 6 votes
@Override
public void onCreate(Bundle savedInstanceState)
{
    setKeepInstance(true);
    setThemeDark(ThemeUtil.isDarkTheme(getActivity()));

    super.onCreate(savedInstanceState);

    if (null != savedInstanceState) {
        mPath = (File) savedInstanceState.getSerializable(KEY_PATH);
        mTypeMask = savedInstanceState.getInt(KEY_MASK);
        mCanSelectMulti = savedInstanceState.getBoolean(KEY_CAN_SEL_MULTI);
        mCanWrite = savedInstanceState.getBoolean(KEY_WRITABLE);
        mSavedPathList = savedInstanceState.getStringArrayList(KEY_SELECTED_ITEMS);
    }

    mAdapter = new LocalResourceListAdapter();
    mAdapter.setSingleSelectable(!mCanSelectMulti);
    mAdapter.setOnChangePathListener(this);
    mAdapter.addOnSelectionChangedListener(this);

    runLoader();
}
 
Example 2
Project: mvvm-template   File: MessageDialogView.java   View Source Code Vote up 6 votes
@SuppressWarnings("ConstantConditions") @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Bundle bundle = getArguments();
    title.setText(bundle.getString("bundleTitle"));
    String msg = bundle.getString("bundleMsg");
    if (bundle.getBoolean("isMarkDown")) {
        if (msg != null) {
            message.setVisibility(View.GONE);
            prettifyWebView.setVisibility(View.VISIBLE);
            prettifyWebView.setGithubContent(msg, null, false, false);
            prettifyWebView.setNestedScrollingEnabled(false);
        }
    } else {
        message.setText(msg);
    }
    if (bundle != null) {
        boolean hideCancel = bundle.getBoolean("hideCancel");
        if (hideCancel) cancel.setVisibility(View.GONE);
        initButton(bundle);
    }
}
 
Example 3
Project: sctalk   File: PullToRefreshBase.java   View Source Code Vote up 6 votes
@Override
protected final void onRestoreInstanceState(Parcelable state) {
	if (state instanceof Bundle) {
		Bundle bundle = (Bundle) state;

		setMode(Mode.mapIntToValue(bundle.getInt(STATE_MODE, 0)));
		mCurrentMode = Mode.mapIntToValue(bundle.getInt(STATE_CURRENT_MODE, 0));

		mScrollingWhileRefreshingEnabled = bundle.getBoolean(STATE_SCROLLING_REFRESHING_ENABLED, false);
		mShowViewWhileRefreshing = bundle.getBoolean(STATE_SHOW_REFRESHING_VIEW, true);

		// Let super Restore Itself
		super.onRestoreInstanceState(bundle.getParcelable(STATE_SUPER));

		State viewState = State.mapIntToValue(bundle.getInt(STATE_STATE, 0));
		if (viewState == State.REFRESHING || viewState == State.MANUAL_REFRESHING) {
			setState(viewState, true);
		}

		// Now let derivative classes restore their state
		onPtrRestoreInstanceState(bundle);
		return;
	}

	super.onRestoreInstanceState(state);
}
 
Example 4
Project: IO_Classic_WatchFace   File: IOClassicWatchFaceService.java   View Source Code Vote up 6 votes
@Override
public void onPropertiesChanged(Bundle properties) {
    super.onPropertiesChanged(properties);

    mLowBitAmbient = properties.getBoolean(PROPERTY_LOW_BIT_AMBIENT, false);
    mBurnInProtection = properties.getBoolean(PROPERTY_BURN_IN_PROTECTION, false);

    //Updates complications to properly render in Ambient Mode based on device
    for (int COMPLICATION_ID : COMPLICATION_IDS) {
        final ComplicationDrawable complicationDrawable
                = mComplicationDrawableSparseArray.get(COMPLICATION_ID);

        if (complicationDrawable != null) {
            complicationDrawable.setLowBitAmbient(mLowBitAmbient);
            complicationDrawable.setBurnInProtection(mBurnInProtection);
        }
    }
}
 
Example 5
Project: boohee_v5.6   File: c.java   View Source Code Vote up 6 votes
public c(Bundle bundle) {
    super(bundle);
    this.a = bundle.getString("ext_msg_type");
    this.e = bundle.getString("ext_msg_lang");
    this.d = bundle.getString("ext_msg_thread");
    this.f = bundle.getString("ext_msg_sub");
    this.g = bundle.getString("ext_msg_body");
    this.h = bundle.getString("ext_body_encode");
    this.j = bundle.getString("ext_msg_appid");
    this.i = bundle.getBoolean("ext_msg_trans", false);
    this.o = bundle.getBoolean("ext_msg_encrypt", false);
    this.k = bundle.getString("ext_msg_seq");
    this.l = bundle.getString("ext_msg_mseq");
    this.m = bundle.getString("ext_msg_fseq");
    this.n = bundle.getString("ext_msg_status");
}
 
Example 6
Project: siiMobilityAppKit   File: MainActivity.java   View Source Code Vote up 5 votes
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    // enable Cordova apps to be started in the background
    Bundle extras = getIntent().getExtras();
    if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
        moveTaskToBack(true);
    }

    // Set by <content src="index.html" /> in config.xml
    loadUrl(launchUrl);
}
 
Example 7
Project: samba-documents-provider   File: MountServerActivity.java   View Source Code Vote up 5 votes
private void restoreSavedInstanceState(@Nullable Bundle savedInstanceState) {
  if (savedInstanceState == null) {
    return;
  }

  mSharePathEditText.setText(savedInstanceState.getString(SHARE_PATH_KEY, ""));

  final boolean needsPassword = savedInstanceState.getBoolean(NEEDS_PASSWORD_KEY);
  setNeedsPasswordState(needsPassword);
  if (needsPassword) {
    mDomainEditText.setText(savedInstanceState.getString(DOMAIN_KEY, ""));
    mUsernameEditText.setText(savedInstanceState.getString(USERNAME_KEY, ""));
    mPasswordEditText.setText(savedInstanceState.getString(PASSWORD_KEY, ""));
  }
}
 
Example 8
Project: SmART-Form   File: CameraActivity.java   View Source Code Vote up 5 votes
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);

    mIsCapturing = savedInstanceState.getBoolean(KEY_IS_CAPTURING, mCameraData == null);
    if (mCameraData != null) {
        setupImageDisplay();
    } else {
        setupImageCapture();
    }
}
 
Example 9
Project: container   File: VAccountManagerService.java   View Source Code Vote up 5 votes
@Override
public void onResult(Bundle result) {
	mNumResults++;
	if (result == null) {
		onError(AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle");
		return;
	}
	if (result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, false)) {
		mAccountsWithFeatures.add(mAccountsOfType[mCurrentAccount]);
	}
	mCurrentAccount++;
	checkAccount();
}
 
Example 10
Project: q-mail   File: MessageSecurityPresenter.java   View Source Code Vote up 5 votes
public MessageSecurityPresenter(Bundle savedInstanceState, MessageSecurityMvpView messageSecurityMvpView) {
    this.messageSecurityMvpView = messageSecurityMvpView;

    if (savedInstanceState != null) {
        overrideCryptoWarning = savedInstanceState.getBoolean("overrideCryptoWarning");
    }
}
 
Example 11
Project: androidtv-sample   File: PlaybackOverlayFragment.java   View Source Code Vote up 5 votes
private void playVideo(Video video, Bundle extras) {
    updateSelectedVideo(video);
    preparePlayer();
    setPlaybackState(PlaybackState.STATE_PAUSED);
    if (extras.getBoolean(AUTO_PLAY)) {
        play();
    } else {
        pause();
    }
}
 
Example 12
Project: androidtv-sample   File: SyncAdapter.java   View Source Code Vote up 5 votes
/**
 * Called periodically by the system in every {@code FULL_SYNC_FREQUENCY_SEC}.
 */
@Override
public void onPerformSync(Account account, Bundle extras, String authority,
        ContentProviderClient provider, SyncResult syncResult) {
    Log.d(TAG, "onPerformSync(" + account + ", " + authority + ", " + extras + ")");
    String inputId = extras.getString(SyncAdapter.BUNDLE_KEY_INPUT_ID);
    if (inputId == null) {
        return;
    }
    XmlTvParser.TvListing listings = RichFeedUtil.getRichTvListings(mContext);
    LongSparseArray<XmlTvParser.XmlTvChannel> channelMap = TvContractUtils.buildChannelMap(
            mContext.getContentResolver(), inputId, listings.channels);
    boolean currentProgramOnly = extras.getBoolean(
            SyncAdapter.BUNDLE_KEY_CURRENT_PROGRAM_ONLY, false);
    long startMs = System.currentTimeMillis();
    long endMs = startMs + FULL_SYNC_WINDOW_SEC * 1000;
    if (currentProgramOnly) {
        // This is requested from the setup activity, in this case, users don't need to wait for
        // the full sync. Sync the current programs first and do the full sync later in the
        // background.
        endMs = startMs + SHORT_SYNC_WINDOW_SEC * 1000;
    }
    for (int i = 0; i < channelMap.size(); ++i) {
        Uri channelUri = TvContract.buildChannelUri(channelMap.keyAt(i));
        List<Program> programs = getPrograms(channelUri, channelMap.valueAt(i),
                listings.programs, startMs, endMs);
        updatePrograms(channelUri, programs);
    }
}
 
Example 13
Project: airgram   File: GroupCreateActivity.java   View Source Code Vote up 5 votes
public GroupCreateActivity(Bundle args) {
    super(args);
    chatType = args.getInt("chatType", ChatObject.CHAT_TYPE_CHAT);
    isAlwaysShare = args.getBoolean("isAlwaysShare", false);
    isNeverShare = args.getBoolean("isNeverShare", false);
    isGroup = args.getBoolean("isGroup", false);
    maxCount = chatType == ChatObject.CHAT_TYPE_CHAT ? MessagesController.getInstance().maxMegagroupCount : MessagesController.getInstance().maxBroadcastCount;
}
 
Example 14
Project: prada   File: SettingReceiver.java   View Source Code Vote up 5 votes
private void doUploadSettingChange(Context context, Intent intent) {
    Log.i(TAG, "doUploadSettingChange");
    Bundle extras = intent.getExtras();
    boolean isAgreeUpload = extras.getBoolean("isAgreeUpload");
    Log.i(TAG, "isAgreeUpload: " + isAgreeUpload);
}
 
Example 15
Project: Android-UtilCode   File: BaseFragment.java   View Source Code Vote up 5 votes
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (savedInstanceState != null) {
        boolean isSupportHidden = savedInstanceState.getBoolean(STATE_SAVE_IS_HIDDEN);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        if (isSupportHidden) {
            ft.hide(this);
        } else {
            ft.show(this);
        }
        ft.commit();
    }
    Log.d(TAG, "onCreate: ");
}
 
Example 16
Project: FireFiles   File: DetailFragment.java   View Source Code Vote up 5 votes
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Bundle args = getArguments();
	if(null != args){
		doc = args.getParcelable(EXTRA_DOC);
		isDialog = args.getBoolean(EXTRA_IS_DIALOG);
	}
}
 
Example 17
Project: lighthouse   File: PodcastsActivity.java   View Source Code Vote up 5 votes
@Override
protected void onCreate(@Nullable Bundle state) {
    super.onCreate(state);

    IntentFilter filter = new IntentFilter();
    filter.addAction(RecordsActivity.ACTION_VIEW);
    registerReceiver(viewReceiver, filter);

    boolean requestList = true;
    if (state != null) {
        boolean isContentView = state.getBoolean(STATE_CONTENT_VIEW, true);
        if (isContentView) {
            FragmentManager fragmentManager = getFragmentManager();
            PodcastsDataFragment dataFragment = (PodcastsDataFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG);
            if (dataFragment != null) {
                podcasts = dataFragment.getPodcasts();
                requestList = podcasts == null || podcasts.list().isEmpty();
            }
        }
    }
    if (podcasts == null) {
        podcasts = new Podcasts();
    }

    adapter = new PodcastsAdapter(this, podcasts.list());
    initializeView();

    if (requestList) {
        requestList();
    } else {
        showContentView();
    }
}
 
Example 18
Project: GitHub   File: MyCustomViewState.java   View Source Code Vote up 5 votes
@Override public RestorableViewState restoreInstanceState(Bundle in) {
  if (in == null) {
    return null;
  }

  showingA = in.getBoolean(KEY_STATE, true);
  data = in.getParcelable(KEY_DATA);
  return this;
}
 
Example 19
Project: Notepad2   File: SmoothCheckBox.java   View Source Code Vote up 5 votes
@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof Bundle) {
        Bundle bundle = (Bundle) state;
        boolean isChecked = bundle.getBoolean(KEY_INSTANCE_STATE);
        setChecked(isChecked);
        super.onRestoreInstanceState(bundle.getParcelable(KEY_INSTANCE_STATE));
        return;
    }
    super.onRestoreInstanceState(state);
}
 
Example 20
Project: mvvm-template   File: RepoFilePathsViewModel.java   View Source Code Vote up 4 votes
@Override
protected void onFirsTimeUiCreate(@Nullable Bundle bundle) {
    if (bundle != null) {
        repoId = bundle.getString(BundleConstant.ID);
        login = bundle.getString(BundleConstant.EXTRA);
        path = Objects.toString(bundle.getString(BundleConstant.EXTRA_TWO), "");
        currentBranch = Objects.toString(bundle.getString(BundleConstant.EXTRA_THREE), "master");
        boolean forceAppend = bundle.getBoolean(BundleConstant.EXTRA_FOUR);
        if (InputHelper.isEmpty(repoId) || InputHelper.isEmpty(login)) {
            throw new NullPointerException(String.format("error, repoId(%s) or login(%s) is null", repoId, login));
        }
        if (forceAppend && paths.isEmpty()) {
            List<RepoFile> repoFiles = new ArrayList<>();
            if (!InputHelper.isEmpty(path)) {
                Uri uri = Uri.parse(path);
                StringBuilder builder = new StringBuilder();
                if (uri.getPathSegments() != null && !uri.getPathSegments().isEmpty()) {
                    List<String> pathSegments = uri.getPathSegments();
                    for (int i = 0; i < pathSegments.size(); i++) {
                        String name = pathSegments.get(i);
                        RepoFile file = new RepoFile();
                        if (i == 0) {
                            builder.append(name);
                        } else {
                            builder.append("/").append(name);
                        }
                        file.setPath(builder.toString());
                        file.setName(name);
                        repoFiles.add(file);
                    }
                }
                if (!repoFiles.isEmpty()) {
                    paths.addAll(repoFiles);
                    setData(paths, true);
                }
            }
        }
        onDataReady.setValue(true);
    } else {
        throw new NullPointerException("Bundle is null");
    }
}