Example usage for android.os Bundle EMPTY

List of usage examples for android.os Bundle EMPTY

Introduction

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

Prototype

Bundle EMPTY

To view the source code for android.os Bundle EMPTY.

Click Source Link

Usage

From source file:com.google.android.demos.atom.app.FeedActivity.java

private void reload() {
    getSupportLoaderManager().restartLoader(LOADER_ENTRIES, Bundle.EMPTY, this);
}

From source file:com.nononsenseapps.feeder.ui.FeedFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        id = getArguments().getLong(ARG_FEED_ID, -1);
        title = getArguments().getString(ARG_FEED_TITLE);
        url = getArguments().getString(ARG_FEED_URL);
        tag = getArguments().getString(ARG_FEED_TAG);

        // It's a tag, use as title
        if (id < 1) {
            title = tag;//from   w w  w. j  a v  a2s .  c  om
        }

        // Special tag
        if (id < 1 && (title == null || title.isEmpty())) {
            title = getString(R.string.no_tag);
        }
    }

    setHasOptionsMenu(true);

    // Load some RSS
    getLoaderManager().restartLoader(FEEDITEMS_LOADER, Bundle.EMPTY, this);
    // Load feed itself if missing info
    if (id > 0 && (title == null || title.isEmpty())) {
        getLoaderManager().restartLoader(FEED_LOADER, Bundle.EMPTY, this);
    } else {
        // Get notification settings at least
        getLoaderManager().restartLoader(FEED_SETTINGS_LOADER, Bundle.EMPTY, this);
    }
}

From source file:com.ubuntuone.android.files.service.MetaService.java

private void getUser(final ResultReceiver receiver) {
    api.getUser(new U1UserListener() {
        @Override// w  ww  .j a va2s.c o m
        public void onStart() {
            if (receiver != null)
                receiver.send(Status.RUNNING, Bundle.EMPTY);
        }

        @Override
        public void onSuccess(U1User user) {
            onGetUserSuccess(user);
        }

        @Override
        public void onUbuntuOneFailure(U1Failure failure) {
            MetaService.this.onUbuntuOneFailure(failure, receiver);
        }

        @Override
        public void onFailure(U1Failure failure) {
            MetaService.this.onFailure(failure, receiver);
        }

        @Override
        public void onFinish() {
            if (receiver != null)
                receiver.send(Status.FINISHED, Bundle.EMPTY);
        }
    });
}

From source file:com.sefford.beauthentic.activities.LoginActivity.java

void performLogin() {
    final AccountManager am = AccountManager.get(this);
    final Bundle data = new Bundle();
    data.putString(AuthenticAuthenticator.EXTRA_PASSWORD, etPassword.getText().toString());
    data.putInt(AuthenticAuthenticator.EXTRA_TYPE, AuthenticAuthenticator.Type.PASSWORD.ordinal());
    final Account account = new Account(etUsername.getText().toString(), AuthenticAuthenticator.ACCOUNT_TYPE);
    am.getAuthToken(account, "", data, true, new AccountManagerCallback<Bundle>() {
        @Override//from w  w  w  . ja  v  a 2  s . com
        public void run(AccountManagerFuture<Bundle> future) {
            try {
                final Bundle result = future.getResult();
                if (result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT)) {
                    Sessions.addAccount(am, account, etPassword.getText().toString(), Bundle.EMPTY);
                    am.setAuthToken(account, AuthenticAuthenticator.AUTHTOKEN_TYPE,
                            result.getString(AccountManager.KEY_AUTHTOKEN));
                    am.setUserData(account, AuthenticAuthenticator.EXTRA_TYPE,
                            Integer.toString(AuthenticAuthenticator.Type.PASSWORD.ordinal()));
                    notifyLoginToGCM(AuthenticAuthenticator.Type.PASSWORD.ordinal(), account.name,
                            etPassword.getText().toString(), result.getString(AccountManager.KEY_AUTHTOKEN));
                    googleApi
                            .saveCredential(
                                    new Credential.Builder(account.name)
                                            .setPassword(etPassword.getText().toString()).build(),
                                    new SmartlockCredentialCallback());
                } else {
                    Snackbar.make(vLoginForm, R.string.error_invalid_credentials, Snackbar.LENGTH_LONG).show();
                }
            } catch (OperationCanceledException e) {
                Snackbar.make(vLoginForm, R.string.error_operation_cancelled, Snackbar.LENGTH_LONG).show();
            } catch (IOException e) {
                Snackbar.make(vLoginForm, R.string.error_not_connected_to_internet, Snackbar.LENGTH_LONG)
                        .show();
            } catch (AuthenticatorException e) {
                Snackbar.make(vLoginForm, R.string.error_invalid_credentials, Snackbar.LENGTH_LONG).show();
            }
        }

    }, null);
}

From source file:se.leap.bitmaskclient.Dashboard.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.about_leap:
        showAbout();//from  w w w.j av a 2s.co  m
        return true;
    case R.id.log_window:
        showLog();
        return true;
    case R.id.switch_provider:
        switching_provider = true;
        if (User.loggedIn())
            user_status_fragment.logOut();
        else
            switchProvider();
        return true;
    case R.id.signup_button:
        sessionDialog(Bundle.EMPTY);
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

From source file:net.abcdroid.devfest12.ui.tablet.SessionsVendorsMultiPaneActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case android.R.id.home:
        if (mShowHideMasterLayout != null && !mShowHideMasterLayout.isMasterVisible()) {
            // If showing the detail view, pressing Up should show the master pane.
            mShowHideMasterLayout.showMaster(true, 0);
            return true;
        }/*www.ja  va 2  s .c o m*/
        break;

    case R.id.menu_search:
        if (!UIUtils.hasHoneycomb()) {
            startSearch(null, false, Bundle.EMPTY, false);
            return true;
        }
        break;
    }
    return super.onOptionsItemSelected(item);
}

From source file:com.google.android.apps.iosched.ui.tablet.SessionsVendorsMultiPaneActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int itemId = item.getItemId();
    if (itemId == android.R.id.home) {
        if (mShowHideMasterLayout != null && !mShowHideMasterLayout.isMasterVisible()) {
            // If showing the detail view, pressing Up should show the master pane.
            mShowHideMasterLayout.showMaster(true, 0);
            return true;
        }/*from  ww  w. j  a va  2  s. c  o  m*/
    } else if (itemId == R.id.menu_search) {
        if (!UIUtils.hasHoneycomb()) {
            startSearch(null, false, Bundle.EMPTY, false);
            return true;
        }
    }
    return super.onOptionsItemSelected(item);
}

From source file:com.gaba.alex.trafficincidents.MainActivity.java

private void configurePeriodicSync(Account appAccount) {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    int hourlySyncInterval = Integer
            .parseInt(preferences.getString(getString(R.string.pref_auto_refresh_key), "6"));
    if (hourlySyncInterval == 0) {
        ContentResolver.setSyncAutomatically(appAccount, AUTHORITY, false);
    } else {/*from  www  .  java 2  s .  co  m*/
        long syncInterval = hourlySyncInterval * SECONDS_PER_HOUR;
        ContentResolver.setSyncAutomatically(appAccount, AUTHORITY, true);
        ContentResolver.addPeriodicSync(appAccount, AUTHORITY, Bundle.EMPTY, syncInterval);
    }
}

From source file:se.leap.bitmaskclient.Dashboard.java

public void downloadVpnCertificate() {
    boolean is_authenticated = User.loggedIn();
    boolean allowed_anon = preferences.getBoolean(Constants.ALLOWED_ANON, false);
    if (allowed_anon || is_authenticated)
        ProviderAPICommand.execute(Bundle.EMPTY, ProviderAPI.DOWNLOAD_CERTIFICATE, providerAPI_result_receiver);
    else/*from www  . j  a v a  2s .  co m*/
        sessionDialog(Bundle.EMPTY);
}

From source file:com.ubuntuone.android.files.service.MetaService.java

public void getVolumes(final ResultReceiver receiver) {
    // Cached volume node paths.
    final Set<String> cachedNodePaths = MetaUtilities.getUserNodePaths();
    // Fresh volume node paths.
    final List<String> volumeNodePaths = new LinkedList<String>();

    api.getVolumes(new U1VolumeListener() {
        @Override//from w  ww.j a v a2s.  c  o  m
        public void onStart() {
            if (receiver != null)
                receiver.send(Status.RUNNING, Bundle.EMPTY);
        }

        @Override
        public void onSuccess(U1Volume volume) {
            onGetVolumeSuccess(volume, receiver);
            volumeNodePaths.add(volume.getNodePath());
        }

        @Override
        public void onUbuntuOneFailure(U1Failure failure) {
            MetaService.this.onUbuntuOneFailure(failure, receiver);
        }

        @Override
        public void onFailure(U1Failure failure) {
            MetaService.this.onFailure(failure, receiver);
        }

        @Override
        public void onFinish() {
            for (String nodePath : volumeNodePaths) {
                getNode(nodePath, null, false);
                cachedNodePaths.remove(nodePath);
            }
            if (NetworkUtil.isConnected(MetaService.this)) {
                // We are connected, thus left cachedNodePaths are invalid.
                for (String oldNodePath : cachedNodePaths) {
                    MetaUtilities.cleanupTreeByResourcePath(oldNodePath);
                }
            }
            contentResolver.notifyChange(Nodes.CONTENT_URI, null);
            if (receiver != null)
                receiver.send(Status.FINISHED, Bundle.EMPTY);
        }
    });
}