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:dev.drsoran.moloko.fragments.AbstractTaskEditFragment.java

public Bundle getChanges() {
    return changes == null ? Bundle.EMPTY : changes;
}

From source file:com.google.android.demos.rss.app.ChannelActivity.java

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

From source file:net.sf.fakenames.fddemo.PermissionActivity.java

@Override
protected void onDestroy() {
    if (!isChangingConfigurations()) {
        resultReceiver.send(0, Bundle.EMPTY);
    }

    super.onDestroy();
}

From source file:org.smssecure.smssecure.ConversationFragment.java

private void initializeListAdapter() {
    if (this.recipients != null && this.threadId != -1) {
        ConversationAdapter adapter = new ConversationAdapter(getActivity(), masterSecret, locale,
                selectionClickListener, null, this.recipients);
        list.setAdapter(adapter);/*ww w  .ja v  a 2s  . c  o  m*/
        list.addItemDecoration(new StickyHeaderDecoration(adapter, false, false));

        setLastSeen(lastSeen);
        getLoaderManager().restartLoader(0, Bundle.EMPTY, this);
        list.getItemAnimator().setMoveDuration(120);
    }
}

From source file:no.ntnu.osnap.social.Request.java

/**
 * Returns the parameters associated with this request as a {@link Bundle} a
 * or an {@code EMPTY} {@link Bundle} if none exist.
 *///from  ww w .j a  v a 2s .co m
public Bundle getParams() {
    Bundle ret = new Bundle(Bundle.EMPTY);
    if (mBundle.containsKey("params")) {
        ret = mBundle.getBundle("params");
    }
    return ret;
}

From source file:com.pitchedapps.primenumbercalculator.Calculator.java

License:asdf

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_calculator);

    prefs = getSharedPreferences("prime", MODE_PRIVATE);
    editor = getSharedPreferences("prime", MODE_PRIVATE).edit();

    mDisplayView = findViewById(R.id.display);
    mInputEditText = (CalculatorEditText) findViewById(R.id.input);
    mResultEditText = (CalculatorEditText) findViewById(R.id.result);
    mPadViewPager = (ViewPager) findViewById(R.id.pad_pager);
    mDeleteButton = findViewById(R.id.del);
    mClearButton = findViewById(R.id.clr);
    mHelpVersionName = (TextView) findViewById(R.id.help_version_number);

    savedInstanceState = savedInstanceState == null ? Bundle.EMPTY : savedInstanceState;
    setState(CalculatorState.values()[savedInstanceState.getInt(KEY_CURRENT_STATE,
            CalculatorState.INPUT.ordinal())]);

    PackageInfo appInfo = null;/* w  ww.j av  a  2 s . c  o  m*/
    try {
        appInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
    assert appInfo != null;
    mHelpVersionName.setText("v" + appInfo.versionName);

    mInputEditText.setText(savedInstanceState.getString(KEY_CURRENT_EXPRESSION, ""));
    mInputEditText.setEditableFactory(mInputEditableFactory);
    mInputEditText.addTextChangedListener(mInputTextWatcher);
    mInputEditText.setOnKeyListener(mInputOnKeyListener);
    mInputEditText.setOnTextSizeChangeListener(this);
    mDeleteButton.setOnLongClickListener(this);

    themeEngine();

    //Setup donations
    final IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
        public void onQueryInventoryFinished(IabResult result, Inventory inventory) {

            if (inventory != null) {
                if (inventory.hasPurchase("prime.donation.1") || inventory.hasPurchase("prime.donation.2")
                        || inventory.hasPurchase("prime.donation.3")
                        || inventory.hasPurchase("prime.donation.5")
                        || inventory.hasPurchase("prime.donation.10")) {
                    Log.d("PNC: ", "IAP inventory contains a donation");

                    mIsPremium = true;
                }
            }
            if (isPremium()) {
                mGoogleCatalog = GOOGLE_CATALOG_PRO;
            }
        }
    };

    if (isStoreVersion()) {
        mHelper = new IabHelper(Calculator.this, GOOGLE_PUBKEY);
        mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
            public void onIabSetupFinished(IabResult result) {
                if (!result.isSuccess()) {
                    Log.d("PNC: ", "In-app Billing setup failed: " + result);
                } else {
                    mHelper.queryInventoryAsync(false, mGotInventoryListener);
                }

            }
        });
    }

    initiateCredits();
}

From source file:com.conferenceengineer.android.iosched.ui.tablet.SessionsSandboxMultiPaneActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case android.R.id.home:
        if (mSlidingPaneLayout.isSlideable() && !mSlidingPaneLayout.isOpen()) {
            // If showing the detail view, pressing Up should show the master pane.
            mSlidingPaneLayout.openPane();
            return true;
        }/*from   w w w .  jav a 2s  .  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:pt.up.mobile.authenticator.AuthenticatorActivity.java

/**
 * Called when response is received from the server for authentication
 * request. See onAuthenticationResult(). Sets the
 * AccountAuthenticatorResult which is sent back to the caller. We store the
 * authToken that's returned from the server as the 'password' for this
 * account - so we're never storing the user's actual password locally.
 * /*from   w w  w.jav  a 2s  .co m*/
 * @param result
 *            the confirmCredentials result.
 */
@TargetApi(8)
private void finishLogin(final User user) {

    Log.i(TAG, "finishLogin()");
    new Thread(new Runnable() {
        @Override
        public void run() {
            final Account account = new Account(mUsername, Constants.ACCOUNT_TYPE);
            if (mRequestNewAccount) {
                final ContentValues values = new ContentValues();
                values.put(SigarraContract.Users.CODE, user.getUserCode());
                values.put(SigarraContract.Users.TYPE, user.getType());
                values.put(SigarraContract.Users.ID, account.name);
                getContentResolver().insert(SigarraContract.Users.CONTENT_URI, values);
                // Set contacts sync for this account.

                if (!mAccountManager.addAccountExplicitly(account, mPassword, Bundle.EMPTY)) {
                    getContentResolver().delete(SigarraContract.Users.CONTENT_URI,
                            SigarraContract.Users.PROFILE,
                            SigarraContract.Users.getUserSelectionArgs(account.name));
                    finish();
                }
                String syncIntervalValue = PreferenceManager
                        .getDefaultSharedPreferences(getApplicationContext())
                        .getString(getString(R.string.key_sync_interval),
                                Integer.toString(getResources().getInteger(R.integer.default_sync_interval)));

                String syncNotIntervalValue = PreferenceManager
                        .getDefaultSharedPreferences(getApplicationContext())
                        .getString(getString(R.string.key_notifications_sync_interval),
                                Integer.toString(getResources().getInteger(R.integer.default_sync_interval)));

                ContentResolver.setSyncAutomatically(account, SigarraContract.CONTENT_AUTHORITY, true);
                ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true);
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
                    ContentResolver.addPeriodicSync(account, SigarraContract.CONTENT_AUTHORITY, Bundle.EMPTY,
                            Integer.parseInt(syncIntervalValue) * 3600);
                    ContentResolver.addPeriodicSync(account, SigarraContract.CONTENT_AUTHORITY,
                            SigarraSyncAdapterUtils.getNotificationsPeriodicBundle(),
                            Integer.parseInt(syncNotIntervalValue) * 3600);
                } else {
                    PeriodicSyncReceiver.cancelPreviousAlarms(getApplicationContext(), account,
                            SigarraContract.CONTENT_AUTHORITY, Bundle.EMPTY);
                    PeriodicSyncReceiver.addPeriodicSync(getApplicationContext(), account,
                            SigarraContract.CONTENT_AUTHORITY, Bundle.EMPTY,
                            Integer.parseInt(syncIntervalValue) * 3600);

                    PeriodicSyncReceiver.addPeriodicSync(getApplicationContext(), account,
                            SigarraContract.CONTENT_AUTHORITY, SigarraSyncAdapterUtils.getNotificationsBundle(),
                            Integer.parseInt(syncNotIntervalValue) * 3600);
                }
            } else {
                mAccountManager.setPassword(account, user.getPassword());
            }
            final Intent intent = new Intent();
            intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, mUsername);
            intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE);
            setAccountAuthenticatorResult(intent.getExtras());
            setResult(RESULT_OK, intent);
            finish();
        }
    }).start();
}

From source file:net.niyonkuru.koodroid.service.SessionService.java

/**
 * Announce success to the available receiver
 *//*from ww  w . j  a  v  a 2 s  . c  om*/
private void announce(ResultReceiver receiver, int status) {
    if (receiver != null) {
        receiver.send(status, Bundle.EMPTY);
    }
}

From source file:com.gdgdevfest.android.apps.devfestbcn.ui.HomeActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.menu_refresh:
        triggerRefresh();/*  w w w  .j  a  v a2s.co m*/
        return true;

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

    case R.id.menu_about:
        HelpUtils.showAbout(this);
        return true;

    case R.id.menu_settings:
        startActivity(new Intent(this, SettingsActivity.class));
        return true;

    case R.id.menu_sign_out:
        AccountUtils.signOut(this);
        finish();
        return true;
    }
    return super.onOptionsItemSelected(item);
}