List of usage examples for android.os Bundle putBoolean
public void putBoolean(@Nullable String key, boolean value)
From source file:au.com.wallaceit.reddinator.ViewRedditActivity.java
/** * Step 2: Setup TabHost/* ww w .j av a 2s. c o m*/ */ private void initialiseTabHost(Bundle args) { Bundle rargs = new Bundle(); rargs.putBoolean("loadcom", true); //rargs.putString("cookie", global.mRedditData.getSessionCookie()); mTabHost = (TabHost) findViewById(android.R.id.tabhost); mTabHost.setup(); if (prefs.getString("widgetthemepref", "1").equals("1")) { mTabHost.getTabWidget().setBackgroundColor(Color.parseColor("#CEE3F8")); // set light theme } else { mTabHost.getTabWidget().setBackgroundColor(Color.parseColor("#5F99CF")); // set dark theme } // add tabs TabInfo tabInfo; ViewRedditActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab1").setIndicator("Content"), (tabInfo = new TabInfo("Tab1", TabWebFragment.class, args))); this.mapTabInfo.put(tabInfo.tag, tabInfo); ViewRedditActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab2").setIndicator("Reddit"), (tabInfo = new TabInfo("Tab2", TabWebFragment.class, rargs))); this.mapTabInfo.put(tabInfo.tag, tabInfo); // Default to first tab // get shared preferences SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ViewRedditActivity.this); if (prefs.getBoolean("commentsfirstpref", false)) { this.mTabHost.setCurrentTab(1); this.onTabChanged("Tab2"); // load comments tab first } else { this.onTabChanged("Tab1"); } // set change listener mTabHost.setOnTabChangedListener(this); }
From source file:com.hichinaschool.flashcards.anki.StudyOptionsFragment.java
public static StudyOptionsFragment newInstance(long deckId, boolean onlyFnsMsg, Bundle cramInitialConfig) { StudyOptionsFragment f = new StudyOptionsFragment(); // Supply index input as an argument. Bundle args = new Bundle(); args.putLong("deckId", deckId); args.putBoolean("onlyFnsMsg", onlyFnsMsg); args.putBundle("cramInitialConfig", cramInitialConfig); f.setArguments(args);/*w ww . j av a 2 s . com*/ return f; }
From source file:com.brodev.socialapp.view.VideoPlay.java
/** Called when the activity is first created. */ @Override// ww w .j ava 2s . com public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.video_player); if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } getSupportActionBar().setDisplayHomeAsUpEnabled(true); user = (User) getApplication().getApplicationContext(); phraseManager = new PhraseManager(getApplicationContext()); colorView = new ColorView(getApplicationContext()); Bundle bundle = getIntent().getExtras(); video = (Video) bundle.get("video"); getSupportActionBar().setTitle(phraseManager.getPhrase(getApplicationContext(), "video.video")); if (video.getTime_stamp().equals("0")) { this.getVideoAdapter(); } initView(); // get comment fragment Bundle comment = new Bundle(); comment.putString("type", "video"); comment.putInt("itemId", video.getVideo_id()); comment.putInt("totalComment", video.getTotal_comment()); comment.putInt("total_like", video.getTotal_like()); comment.putBoolean("is_liked", video.getIs_like()); comment.putBoolean("can_post_comment", video.getCan_post_comment()); CommentFragment commentFragment = new CommentFragment(); commentFragment.setArguments(comment); getSupportFragmentManager().beginTransaction().add(R.id.commentfragment_wrap, commentFragment).commit(); }
From source file:es.uniovi.imovil.fcrtrainer.BaseExerciseFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(STATE_IS_PLAYING, mIsPlaying); outState.putLong(STATE_CONSUMED_TIME_MS, mDurationMs - getRemainingTimeMs()); outState.putLong(STATE_DURATION_TIME_MS, mDurationMs); outState.putInt(STATE_SCORE, mScore); }
From source file:com.application.treasurehunt.ScanQRCodeActivity.java
@Override public void onSaveInstanceState(Bundle savedInstanceState) { savedInstanceState.putParcelable("lastLocation", mLastLocation); savedInstanceState.putBoolean("mLocationServicesChecked", mLocationServicesChecked); super.onSaveInstanceState(savedInstanceState); }
From source file:com.mirasense.scanditsdk.plugin.FullScreenPickerActivity.java
@Override public void pickerEnteredState(BarcodePickerWithSearchBar picker, int newState) { // don't produce events in legacy mode. They would be interpreted as scan events. if (mLegacyMode) return;//from w ww .ja v a 2s. c o m Bundle resultBundle = new Bundle(); JSONArray didStopArgs = Marshal.createEventArgs(ScanditSDK.DID_CHANGE_STATE_EVENT, newState); resultBundle.putString("jsonString", didStopArgs.toString()); resultBundle.putBoolean("waitForResult", false); ResultRelay.relayResult(resultBundle); }
From source file:android.support.v17.preference.LeanbackListPreferenceDialogFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putCharSequence(SAVE_STATE_TITLE, mDialogTitle); outState.putCharSequence(SAVE_STATE_MESSAGE, mDialogMessage); outState.putBoolean(SAVE_STATE_IS_MULTI, mMulti); outState.putCharSequenceArray(SAVE_STATE_ENTRIES, mEntries); outState.putCharSequenceArray(SAVE_STATE_ENTRY_VALUES, mEntryValues); if (mMulti) { outState.putStringArray(SAVE_STATE_INITIAL_SELECTIONS, mInitialSelections.toArray(new String[mInitialSelections.size()])); } else {//from ww w . j av a 2 s. c o m outState.putString(SAVE_STATE_INITIAL_SELECTION, mInitialSelection); } }
From source file:cmu.cconfs.instantMessage.activities.SettingsFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if (((IMMainActivity) getActivity()).isConflict) { outState.putBoolean("isConflict", true); } else if (((IMMainActivity) getActivity()).getCurrentAccountRemoved()) { outState.putBoolean(Constant.ACCOUNT_REMOVED, true); }//ww w . ja va 2 s .c om }
From source file:fi.iki.murgo.irssinotifier.IrssiNotifierActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean("rotated", true); outState.putString("channelToView", channelToView); }
From source file:com.google.samples.quickstart.signin.MainActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(KEY_IS_RESOLVING, mIsResolving); outState.putBoolean(KEY_SHOULD_RESOLVE, mShouldResolve); }