Example usage for android.os Bundle getBoolean

List of usage examples for android.os Bundle getBoolean

Introduction

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

Prototype

public boolean getBoolean(String key) 

Source Link

Document

Returns the value associated with the given key, or false if no mapping of the desired type exists for the given key.

Usage

From source file:com.radicaldynamic.groupinform.activities.AccountFolderList.java

@Override
public void synchronizationTaskFinished(Bundle data) {
    if (mProgressDialog != null && mProgressDialog.isShowing())
        mProgressDialog.dismiss();/*  ww  w  . j a  v  a2  s. c  om*/

    if (data.getBoolean(SynchronizeFoldersListener.SUCCESSFUL)) {
        openFolder();
    } else {
        Toast.makeText(getApplicationContext(),
                "Unable to open " + mSelectedFolderName + ". Please try again in a few minutes.",
                Toast.LENGTH_LONG).show();
    }
}

From source file:com.dahl.brendan.wordsearch.model.HighScore.java

public HighScore(Bundle bundle) {
    this.time = bundle.getLong(Constants.KEY_HIGH_SCORE_TIME);
    this.size = bundle.getInt(Constants.KEY_HIGH_SCORE_SIZE);
    this.theme = bundle.getString(Constants.KEY_HIGH_SCORE_THEME);
    this.wordCount = bundle.getInt(Constants.KEY_WORD_COUNT);
    this.name = bundle.getString(Constants.KEY_HIGH_SCORE_NAME);
    this.globalRank = bundle.getInt(Constants.KEY_GLOBAL_RANK);
    this.globalHighScore = bundle.getBoolean(Constants.KEY_GLOBAL_HIGH_SCORE);
    this.rank = bundle.getInt(Constants.KEY_RANK);
    this.score = bundle.getLong(Constants.KEY_HIGH_SCORE);
}

From source file:fi.mikuz.boarder.gui.internet.DownloadBoard.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.internet_download_board);
    setProgressBarIndeterminateVisibility(true);

    mWaitDialog = new TimeoutProgressDialog(DownloadBoard.this, "Waiting for response", TAG, true);

    Bundle extras = getIntent().getExtras();
    mAction = extras.getInt(DownloadBoard.SHOW_KEY);

    if (mAction == SHOW_INTERNET_BOARD) {
        mBoardId = extras.getInt(InternetMenu.BOARD_ID_KEY);
        mLoggedIn = extras.getBoolean(DownloadBoardList.LOGGED_IN_KEY);

        if (mLoggedIn) {
            mUserId = extras.getString(InternetMenu.USER_ID_KEY);
            mSessionToken = extras.getString(InternetMenu.SESSION_TOKEN_KEY);
        }//from  w  w w .  j  a v  a  2s  .  co m

        getBoard();
    } else if (mAction == SHOW_PREVIEW_BOARD) {
        mLoggedIn = false;

        XStream xstream = new XStream();
        JSONObject fakeMessage = (JSONObject) xstream.fromXML(extras.getString(DownloadBoard.JSON_KEY));
        String fakeMessageString = fakeMessage.toString();

        try {

            if (GlobalSettings.getSensitiveLogging())
                Log.v(TAG, "Got a preview: " + fakeMessageString);
            ConnectionSuccessfulResponse fakeResponse = new ConnectionSuccessfulResponse(
                    new JSONObject(fakeMessageString), InternetMenu.mGetBoardURL);
            onConnectionSuccessful(fakeResponse);
        } catch (JSONException e) {
            Log.e(TAG, "Error reading fake json message", e);
        }
    } else {
        throw new IllegalArgumentException("No proper action defined, action: " + mAction);
    }

}

From source file:com.amaze.filemanager.fragments.CompressedExplorerFragment.java

private void onRestoreInstanceState(Bundle savedInstanceState) {
    compressedFile = new File(Uri.parse(savedInstanceState.getString(KEY_URI)).getPath());
    files = savedInstanceState.getParcelableArrayList(KEY_CACHE_FILES);
    isOpen = savedInstanceState.getBoolean(KEY_OPEN);
    elements = savedInstanceState.getParcelableArrayList(KEY_ELEMENTS);
    relativeDirectory = savedInstanceState.getString(KEY_PATH, "");

    decompressor = CompressedHelper.getCompressorInstance(getContext(), compressedFile);
    createViews(elements, relativeDirectory);
}

From source file:com.odoo.addons.customers.CustomerDetails.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.customer_detail);
    OActionBarUtils.setActionBar(this, false);
    fileManager = new OFileManager(this);
    actionBar = getSupportActionBar();//w w w  .  j  a  va  2 s.c o  m
    actionBar.setTitle("");
    if (savedInstanceState != null) {
        mEditMode = savedInstanceState.getBoolean(KEY_MODE);
        newImage = savedInstanceState.getString(KEY_NEW_IMAGE);
    }
    app = (App) getApplicationContext();
    parallaxScrollView = (ParallaxScrollView) findViewById(R.id.parallaxScrollView);
    parallaxScrollView.setActionBar(actionBar);
    userImage = (ImageView) findViewById(android.R.id.icon);
    mTitleView = (TextView) findViewById(android.R.id.title);
    resPartner = new ResPartner(this, null);
    extras = getIntent().getExtras();
    if (extras == null)
        mEditMode = true;
    setupActionBar();
}

From source file:com.starwood.anglerslong.LicenseActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.license);//from   w  w  w  . ja va2 s.co  m

    Bundle bundle = this.getIntent().getExtras();
    getSupportActionBar().setTitle(bundle.getString("abtitle"));
    //        getSupportActionBar().setSubtitle(bundle.getString("subtitle"));
    //        getSupportActionBar().setDisplayHomeAsUpEnabled(true);    // <- This puts the back arrow in actionbar

    if (bundle.containsKey("isArrayEmpty"))
        isArrayEmpty = bundle.getBoolean("isArrayEmpty");

    populateTabs(false); // Populate the tabs within the clicked tab.

}

From source file:com.andryr.musicplayer.fragments.ArtistListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_artist_list, container, false);
    mRecyclerView = (RecyclerView) rootView.findViewById(R.id.list_view);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

    mAdapter = new ArtistListAdapter(getActivity());
    mAdapter.setOnItemClickListener(mOnItemClickListener);
    mRecyclerView.setAdapter(mAdapter);/*from  ww  w  .j  a v  a2  s  .  co m*/

    if (savedInstanceState != null) {
        mShowFastScroller = savedInstanceState.getBoolean(STATE_SHOW_FASTSCROLLER) || mShowFastScroller;
    }

    mFastScroller = (FastScroller) rootView.findViewById(R.id.fastscroller);
    mFastScroller.setShowBubble(mShowScrollerBubble);
    if (mShowFastScroller) {
        mFastScroller.setRecyclerView(mRecyclerView);
        mFastScroller.setSectionIndexer(mAdapter);
    } else {
        mFastScroller.setVisibility(View.GONE);
    }

    return rootView;
}

From source file:cn.njmeter.njmeter.widget.spinner.NiceSpinner.java

@Override
public void onRestoreInstanceState(Parcelable savedState) {
    if (savedState instanceof Bundle) {
        Bundle bundle = (Bundle) savedState;
        selectedIndex = bundle.getInt(SELECTED_INDEX);

        if (adapter != null) {
            setTextInternal(adapter.getItemInDataset(selectedIndex).toString());
            adapter.setSelectedIndex(selectedIndex);
        }//from  w  ww  . j  a v a  2  s .com

        if (bundle.getBoolean(IS_POPUP_SHOWING)) {
            if (popupWindow != null) {
                // Post the show request into the looper to avoid bad token exception
                post(new Runnable() {
                    @Override
                    public void run() {
                        showDropDown();
                    }
                });
            }
        }

        isArrowHidden = bundle.getBoolean(IS_ARROW_HIDDEN, false);
        arrowDrawableResId = bundle.getInt(ARROW_DRAWABLE_RES_ID);
        savedState = bundle.getParcelable(INSTANCE_STATE);
    }
    super.onRestoreInstanceState(savedState);
}

From source file:com.socialapp.eventmanager.LoginActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (savedInstanceState != null) {
        userSkippedLogin = savedInstanceState.getBoolean(USER_SKIPPED_LOGIN_KEY);
    }/* w  ww .  j a  v  a  2 s .co  m*/

    try {
        PackageInfo info = getPackageManager().getPackageInfo("com.socialapp.eventmanager",
                PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            String keyHash = Base64.encodeToString(md.digest(), Base64.DEFAULT);
            Log.d("************* KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
    } catch (PackageManager.NameNotFoundException e) {

    } catch (NoSuchAlgorithmException e) {

    }

    FacebookSdk.sdkInitialize(getApplicationContext());

    callbackManager = CallbackManager.Factory.create();

    accessTokenTracker = new AccessTokenTracker() {
        @Override
        protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken currentAccessToken) {

            checkAndRedirectOnFBLogin();

            if (isResumed) {
                FragmentManager manager = getSupportFragmentManager();
                int backStackSize = manager.getBackStackEntryCount();
                for (int i = 0; i < backStackSize; i++) {
                    manager.popBackStack();
                }
                if (currentAccessToken != null) {
                    // showFragment(SELECTION, false);
                } else {
                    showFragment(SPLASH, true);
                }
            }
        }
    };

    setContentView(R.layout.activity_login);

    FragmentManager fm = getSupportFragmentManager();
    SplashFragment splashFragment = (SplashFragment) fm.findFragmentById(R.id.splashFragment);
    fragments[SPLASH] = splashFragment;

    FragmentTransaction transaction = fm.beginTransaction();
    // for(int i = 0; i < fragments.length; i++) {
    transaction.hide(fragments[0]);
    // }
    transaction.commit();

    splashFragment.setSkipLoginCallback(new SplashFragment.SkipLoginCallback() {
        @Override
        public void onSkipLoginPressed() {
            userSkippedLogin = true;
            //showFragment(SELECTION, false);
        }
    });

    accessTokenTracker.startTracking();

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    String userLoggedIn = prefs.getString("email", null);
    if (userLoggedIn != null) {
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
    }
}

From source file:com.ibm.mobilefirstplatform.clientsdk.android.push.internal.MFPInternalPushMessage.java

public MFPInternalPushMessage(Intent intent) {

    Bundle info = intent.getExtras();
    MFPPushUtils.dumpIntent(intent);//ww  w .j  ava 2 s  .co m

    alert = info.getString(GCM_EXTRA_ALERT);
    url = info.getString(GCM_EXTRA_URL);
    payload = info.getString(GCM_EXTRA_PAYLOAD);
    sound = info.getString(GCM_EXTRA_SOUND);
    bridge = info.getBoolean(GCM_EXTRA_BRIDGE);
    priority = info.getString(GCM_EXTRA_PRIORITY);
    visibility = info.getString(GCM_EXTRA_VISIBILITY);
    redact = info.getString(GCM_EXTRA_REDACT);
    key = info.getString(GCM_EXTRA_KEY);
    category = info.getString(GCM_EXTRA_CATEGORY);
    gcmStyle = info.getString(GCM_EXTRA_STYLE);
    iconName = info.getString(GCM_EXTRA_ICONNAME);
    notificationId = info.getInt(GCM_EXTRA_NOTIFICATIONID);

    try {
        JSONObject towers = new JSONObject(payload);
        id = towers.getString(GCM_EXTRA_ID);
    } catch (JSONException e) {
        logger.error(
                "MFPInternalPushMessage: MFPInternalPushMessage() - Exception while parsing JSON, get id.  "
                        + e.toString());
    }
}