Example usage for android.os Bundle putBoolean

List of usage examples for android.os Bundle putBoolean

Introduction

In this page you can find the example usage for android.os Bundle putBoolean.

Prototype

public void putBoolean(@Nullable String key, boolean value) 

Source Link

Document

Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:org.ohmage.auth.Authenticator.java

@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) {
    final Bundle result = new Bundle();
    result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);
    return result;
}

From source file:at.alladin.rmbt.android.terms.RMBTCheckFragment.java

@Override
public void onSaveInstanceState(final Bundle b) {
    super.onSaveInstanceState(b);
    if (checkBox != null)
        b.putBoolean("isChecked", checkBox.isChecked());
}

From source file:com.apptentive.android.sdk.module.engagement.interaction.view.survey.SurveyInteractionView.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(KEY_SURVEY_SUBMITTED, surveySubmitted);
}

From source file:edu.mit.mobile.android.locast.accounts.AbsLocastAuthenticator.java

/**
 * {@inheritDoc}//from   www .  j a  v  a 2  s  .co  m
 */
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) {
    final Bundle result = new Bundle();
    result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);
    return result;
}

From source file:com.openerp.services.MailGroupSyncService.java

public void performSync(Context context, Account account, Bundle extras, String authority,
        ContentProviderClient provider, SyncResult syncResult) {

    try {//from www  .ja v  a2 s  .  c o  m
        Intent intent = new Intent();
        intent.setAction(SyncFinishReceiver.SYNC_FINISH);

        MailGroupDB db = new MailGroupDB(context);
        db.setAccountUser(OpenERPAccountManager.getAccountDetail(context, account.name));
        OEHelper oe = db.getOEInstance();
        if (oe != null && oe.syncWithServer(true)) {
            MailFollowers followers = new MailFollowers(context);

            OEDomain domain = new OEDomain();
            domain.add("partner_id", "=", oe.getUser().getPartner_id());
            domain.add("res_model", "=", db.getModelName());

            if (followers.getOEInstance().syncWithServer(domain, true)) {
                // syncing group messages
                JSONArray group_ids = new JSONArray();
                for (OEDataRow grp : followers.select("res_model = ? AND partner_id = ?",
                        new String[] { db.getModelName(), oe.getUser().getPartner_id() + "" })) {
                    group_ids.put(grp.getInt("res_id"));
                }
                Bundle messageBundle = new Bundle();
                messageBundle.putString("group_ids", group_ids.toString());
                messageBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
                messageBundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
                ContentResolver.requestSync(account, MessageProvider.AUTHORITY, messageBundle);

            }
        }
        if (OpenERPAccountManager.currentUser(context).getAndroidName().equals(account.name))
            context.sendBroadcast(intent);

    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.airbnb.rxgroups.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    groupLifecycleManager.onSaveInstanceState(outState);
    outState.putBoolean(IS_RUNNING, isRunning);
}

From source file:edu.mit.mobile.android.locast.accounts.AbsLocastAuthenticator.java

/**
 * {@inheritDoc}//from   w w  w.  ja va 2 s  .c o  m
 */
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
    if (options != null && options.containsKey(AccountManager.KEY_PASSWORD)) {
        final String password = options.getString(AccountManager.KEY_PASSWORD);
        final Bundle verified = onlineConfirmPassword(account, password);
        final Bundle result = new Bundle();
        result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, verified != null);
        return result;
    }
    // Launch AuthenticatorActivity to confirm credentials
    final Intent intent = getAuthenticator(mContext);
    intent.putExtra(AbsLocastAuthenticatorActivity.EXTRA_USERNAME, account.name);
    intent.putExtra(AbsLocastAuthenticatorActivity.EXTRA_CONFIRMCREDENTIALS, true);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}

From source file:edu.mit.mobile.android.locast.accounts.Authenticator.java

/**
 * {@inheritDoc}// w ww  .j a va  2s  . c  om
 */
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
    if (options != null && options.containsKey(AccountManager.KEY_PASSWORD)) {
        final String password = options.getString(AccountManager.KEY_PASSWORD);
        final Bundle verified = onlineConfirmPassword(account, password);
        final Bundle result = new Bundle();
        result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, verified != null);
        return result;
    }
    // Launch AuthenticatorActivity to confirm credentials
    final Intent intent = new Intent(mContext, AuthenticatorActivity.class);
    intent.putExtra(AuthenticatorActivity.EXTRA_USERNAME, account.name);
    intent.putExtra(AuthenticatorActivity.EXTRA_CONFIRMCREDENTIALS, true);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}

From source file:ca.mudar.snoozy.receiver.PowerConnectionReceiver.java

private void notify(Context context, boolean isConnectedPower, boolean hasVibration, boolean hasSound,
        int notifyCount) {
    final Resources res = context.getResources();

    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
            .setSmallIcon(R.drawable.ic_notify).setContentTitle(res.getString(R.string.notify_content_title))
            .setAutoCancel(true);//from w  w  w  . ja v  a2 s . c  o m

    if (notifyCount == 1) {
        final int resContentTextSingle = (isConnectedPower ? R.string.notify_content_text_single_on
                : R.string.notify_content_text_single_off);
        mBuilder.setContentText(res.getString(resContentTextSingle));
    } else {
        mBuilder.setNumber(notifyCount).setContentText(res.getString(R.string.notify_content_text_multi));
    }

    if (hasVibration && hasSound) {
        mBuilder.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND);
    } else if (hasVibration) {
        mBuilder.setDefaults(Notification.DEFAULT_VIBRATE);
    } else if (hasSound) {
        mBuilder.setDefaults(Notification.DEFAULT_SOUND);
    }

    // Creates an explicit intent for an Activity in your app
    Intent resultIntent = new Intent(context, MainActivity.class);
    final Bundle extras = new Bundle();
    extras.putBoolean(Const.IntentExtras.INCREMENT_NOTIFY_GROUP, true);
    extras.putBoolean(Const.IntentExtras.RESET_NOTIFY_NUMBER, true);
    resultIntent.putExtras(extras);
    resultIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP
            | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    mBuilder.setContentIntent(
            PendingIntent.getActivity(context, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT));

    Intent receiverIntent = new Intent(context, PowerConnectionReceiver.class);
    receiverIntent.setAction(Const.IntentActions.NOTIFY_DELETE);
    PendingIntent deleteIntent = PendingIntent.getBroadcast(context, Const.RequestCodes.RESET_NOTIFY_NUMBER,
            receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    mBuilder.setDeleteIntent(deleteIntent);

    NotificationManager mNotificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);

    // NOTIFY_ID allows updates to the notification later on.
    mNotificationManager.notify(Const.NOTIFY_ID, mBuilder.build());
}

From source file:com.github.chenxiaolong.dualbootpatcher.switcher.ZipFlashingOutputFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(EXTRA_IS_RUNNING, mIsRunning);
    outState.putInt(EXTRA_TASK_ID_FLASH_ZIPS, mTaskIdFlashZips);
}