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:com.katamaditya.apps.weather4u.weathersync.Weather4USyncAdapter.java

/**
 * Helper method to have the sync adapter sync immediately
 *
 * @param context The context used to access the account service
 *//*from   w w  w.  j  a v a2  s .com*/
public static void syncImmediately(Context context) {
    //Log.d("Weather4USyncAdapter", "syncImmediately");
    Bundle bundle = new Bundle();
    bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
    bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
    ContentResolver.requestSync(getSyncAccount(context), context.getString(R.string.content_authority), bundle);
}

From source file:com.versobit.kmark.clarity.DbProcessorFragment.java

public static DbProcessorFragment newInstance(String reportsTo, boolean dryRun, boolean backups,
        boolean reboot) {
    DbProcessorFragment frag = new DbProcessorFragment();
    Bundle args = new Bundle();
    args.putString(ARG_REPORTS_TO, reportsTo);
    args.putBoolean(ARG_DRY_RUN, dryRun);
    args.putBoolean(ARG_RETAIN_BACKUPS, backups);
    args.putBoolean(ARG_SOFT_REBOOT, reboot);
    frag.setArguments(args);//  w ww  .j av a2  s. co  m
    return frag;
}

From source file:com.ichi2.anki.StudyOptionsFragment.java

/**
 * Get a new instance of the fragment./*from   w ww  .j  ava 2 s  .c  o  m*/
 * @param withDeckOptions If true, the fragment will load a new activity on top of itself
 *                        which shows the current deck's options. Set to true when programmatically
 *                        opening a new filtered deck for the first time.
 */
public static StudyOptionsFragment newInstance(boolean withDeckOptions) {
    StudyOptionsFragment f = new StudyOptionsFragment();
    Bundle args = new Bundle();
    args.putBoolean("withDeckOptions", withDeckOptions);
    f.setArguments(args);
    return f;
}

From source file:com.alexandrepiveteau.library.tutorial.TutorialFragment.java

private static TutorialFragment getInstance(String name, String description, int imageResource,
        int imageResourceBackground, int imageResourceForeground, boolean hasAnimatedImageResource,
        boolean hasAnimatedImageResourceBackground, boolean hasAnimatedImageResourceForeground,
        int customActionIcon, PendingIntent pendingIntent, String customActionTitle) {
    Bundle bundle = new Bundle();
    bundle.putInt(ARGUMENTS_TUTORIAL_IMAGE, imageResource);
    bundle.putInt(ARGUMENTS_TUTORIAL_IMAGE_BACKGROUND, imageResourceBackground);
    bundle.putInt(ARGUMENTS_TUTORIAL_IMAGE_FOREGROUND, imageResourceForeground);
    bundle.putString(ARGUMENTS_TUTORIAL_NAME, name);
    bundle.putString(ARGUMENTS_TUTORIAL_DESCRIPTION, description);
    bundle.putBoolean(ARGUMENTS_HAS_ANIMATED_IMAGE, hasAnimatedImageResource);
    bundle.putBoolean(ARGUMENTS_HAS_ANIMATED_IMAGE_BACKGROUND, hasAnimatedImageResourceBackground);
    bundle.putBoolean(ARGUMENTS_HAS_ANIMATED_IMAGE_FOREGROUND, hasAnimatedImageResourceForeground);
    bundle.putInt(ARGUMENTS_CUSTOM_ACTION_ICON, customActionIcon);
    bundle.putParcelable(ARGUMENTS_CUSTOM_ACTION_PENDING_INTENT, pendingIntent);
    bundle.putString(ARGUMENTS_CUSTOM_ACTION_TITLE, customActionTitle);

    TutorialFragment tutorialFragment = new TutorialFragment();
    tutorialFragment.setArguments(bundle);
    return tutorialFragment;
}

From source file:com.akop.bach.fragment.playstation.TrophiesFragment.java

public static TrophiesFragment newInstance(PsnAccount account, long titleId, boolean showGameTotals) {
    TrophiesFragment f = new TrophiesFragment();

    Bundle args = new Bundle();
    args.putParcelable("account", account);
    args.putLong("titleId", titleId);
    args.putBoolean("showGameTotals", showGameTotals);
    f.setArguments(args);//from w  ww  .  j  a  v a2 s. co  m

    return f;
}

From source file:at.bitfire.davdroid.ui.AccountActivity.java

protected static void requestSync(Account account) {
    String authorities[] = { ContactsContract.AUTHORITY, CalendarContract.AUTHORITY,
            TaskProvider.ProviderName.OpenTasks.authority };

    for (String authority : authorities) {
        Bundle extras = new Bundle();
        extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); // manual sync
        extras.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true); // run immediately (don't queue)
        ContentResolver.requestSync(account, authority, extras);
    }//from  w w  w  .  j ava2 s  . c  o m
}

From source file:com.akop.bach.fragment.xboxlive.AchievementsFragment.java

public static AchievementsFragment newInstance(XboxLiveAccount account, long titleId, boolean showGameTotals) {
    AchievementsFragment f = new AchievementsFragment();

    Bundle args = new Bundle();
    args.putParcelable("account", account);
    args.putLong("titleId", titleId);
    args.putBoolean("showGameTotals", showGameTotals);
    f.setArguments(args);/* ww  w. j av  a 2  s  .  com*/

    return f;
}

From source file:com.alphabetbloc.accessmrs.services.SyncManager.java

public static void syncData() {
    if (App.DEBUG)
        Log.v(TAG, "SyncData is Requested");
    AccountManager accountManager = AccountManager.get(App.getApp());
    Account[] accounts = accountManager.getAccountsByType(App.getApp().getString(R.string.app_account_type));
    if (accounts.length > 0) {

        sStartSync.set(true);/*from w  ww. j av  a 2 s.  com*/

        Bundle bundle = new Bundle();
        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_FORCE, true);
        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);

        // //this resets the scheduled sync
        ContentResolver.requestSync(accounts[0], App.getApp().getString(R.string.app_provider_authority),
                bundle);
    } else
        UiUtils.toastAlert(App.getApp().getString(R.string.sync_error),
                App.getApp().getString(R.string.no_account_setup));
}

From source file:ca.frozen.curlingtv.activities.VideoFragment.java

public static VideoFragment newInstance(Camera camera, boolean fullScreen) {
    VideoFragment fragment = new VideoFragment();

    Bundle args = new Bundle();
    args.putParcelable(CAMERA, camera);//from ww  w .j  a  v  a  2  s  . c  om
    args.putBoolean(FULL_SCREEN, fullScreen);
    fragment.setArguments(args);

    return fragment;
}

From source file:com.andrada.sitracker.ui.fragment.DirectoryChooserFragment.java

/**
 * Use this factory method to create a new instance of
 * this fragment using the provided parameters.
 *
 * @param newDirectoryName Name of the directory to create.
 * @param initialDirectory Optional argument to define the path of the directory
 *                         that will be shown first.
 *                         If it is not sent or if path denotes a non readable/writable directory
 *                         or it is not a directory, it defaults to
 *                         {@link android.os.Environment#getExternalStorageDirectory()}
 * @return A new instance of fragment DirectoryChooserFragment.
 *//*from w w  w.j  a v a 2s.  c om*/
@NotNull
public static DirectoryChooserFragment newInstance(final String newDirectoryName, final String initialDirectory,
        final Boolean isDirectoryChooser) {
    DirectoryChooserFragment fragment = new DirectoryChooserFragment();
    Bundle args = new Bundle();
    args.putString(ARG_NEW_DIRECTORY_NAME, newDirectoryName);
    args.putString(ARG_INITIAL_DIRECTORY, initialDirectory);
    args.putBoolean(ARG_IS_DIRECTORY_CHOOSER, isDirectoryChooser);
    fragment.setArguments(args);
    return fragment;
}