List of usage examples for android.os Bundle Bundle
public Bundle()
From source file:net.carlh.toast.State.java
private void changed(int p) { for (Handler h : handlers) { Message m = Message.obtain();/*from www . j ava 2s . c om*/ Bundle b = new Bundle(); b.putInt("property", p); m.setData(b); h.sendMessage(m); } }
From source file:com.iStudy.Study.Renren.Util.java
/** * &?URL???key-value?//from w w w .j a v a2s . c o m * * @param s * @return */ @SuppressWarnings("deprecation") public static Bundle decodeUrl(String s) { Bundle params = new Bundle(); if (s != null) { params.putString("url", s); String array[] = s.split("&"); for (String parameter : array) { String v[] = parameter.split("="); if (v.length > 1) { params.putString(v[0], URLDecoder.decode(v[1])); } } } return params; }
From source file:com.krayzk9s.imgurholo.tools.CommentsAsync.java
@Override protected void onPostExecute(Void aVoid) { if (galleryAlbumData != null) { SingleImageFragment fragment = new SingleImageFragment(); Bundle bundle = new Bundle(); bundle.putBoolean("gallery", true); JSONParcelable data = new JSONParcelable(); data.setJSONObject(galleryAlbumData); bundle.putParcelable("imageData", data); fragment.setArguments(bundle);//from w w w . ja v a 2s .co m if (activity != null) { FragmentManager fragmentManager = activity.getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); FrameLayout displayFrag = (FrameLayout) activity.findViewById(R.id.frame_layout_child); if (displayFrag != null) fragmentTransaction.replace(R.id.frame_layout_child, fragment).commitAllowingStateLoss(); else fragmentTransaction.replace(R.id.frame_layout, fragment).commitAllowingStateLoss(); } } }
From source file:com.vmihalachi.turboeditor.fragment.EditorFragment.java
public static EditorFragment newInstance(String filePath) { EditorFragment frag = new EditorFragment(); Bundle args = new Bundle(); args.putString("filePath", filePath); frag.setArguments(args);// ww w . ja va 2s. c o m return frag; }
From source file:com.facebook.login.LoginLogger.java
static Bundle newAuthorizationLoggingBundle(String authLoggerId) { // We want to log all parameters for all events, to ensure stability of columns across // different event types. Bundle bundle = new Bundle(); bundle.putLong(EVENT_PARAM_TIMESTAMP, System.currentTimeMillis()); bundle.putString(EVENT_PARAM_AUTH_LOGGER_ID, authLoggerId); bundle.putString(EVENT_PARAM_METHOD, ""); bundle.putString(EVENT_PARAM_LOGIN_RESULT, ""); bundle.putString(EVENT_PARAM_ERROR_MESSAGE, ""); bundle.putString(EVENT_PARAM_ERROR_CODE, ""); bundle.putString(EVENT_PARAM_EXTRAS, ""); return bundle; }
From source file:com.hybris.mobile.app.commerce.fragment.AddressDialogFragment.java
public static AddressDialogFragment newInstance(boolean nestedFragment, TextWatcher textWatcher) { AddressDialogFragment addressDialogFragment = new AddressDialogFragment(); Bundle args = new Bundle(); args.putBoolean(NESTED_FRAGMENT, nestedFragment); addressDialogFragment.setArguments(args); addressDialogFragment.mTextWatcher = textWatcher; return addressDialogFragment; }
From source file:com.android.volley.toolbox.AndroidAuthenticatorTest.java
@Test(expected = AuthFailureError.class) public void missingAuthToken() throws Exception { Bundle bundle = new Bundle(); when(mAccountManager.getAuthToken(mAccount, "cooltype", false, null, null)).thenReturn(mFuture); when(mFuture.getResult()).thenReturn(bundle); when(mFuture.isDone()).thenReturn(true); when(mFuture.isCancelled()).thenReturn(false); mAuthenticator.getAuthToken();//from w ww .j a v a 2s . c o m }
From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.activities.LevelOneActivity.java
private void setupVideoFragment() { final Intent intent = getIntent(); final Bundle bundle = intent.getBundleExtra(EXTRA); Validate.notNull(bundle, "The bundle supplied to the activity is null."); final String fragmentToShow = bundle.getString(FRAGMENT_TO_SHOW, StringUtils.EMPTY); if (SignVideoFragment.class.getSimpleName().equals(fragmentToShow)) { final Parcelable sign = bundle.getParcelable(SignVideoFragment.SIGN_TO_SHOW); SignVideoFragment signVideoFragment = new SignVideoFragment(); final Bundle args = new Bundle(); args.putParcelable(SignVideoFragment.SIGN_TO_SHOW, sign); signVideoFragment.setArguments(args); setFragment(signVideoFragment, SIGN_VIDEO_TAG); } else {//from w ww. jav a 2s . c om throw new IllegalArgumentException("Cannot show the fragment with name: " + fragmentToShow); } }
From source file:it.sineo.android.tileMapEditor.TileMap.java
/** * Returns a Bundle representation of this map. No transient data is stored. * /*from w ww. j a v a 2s .co m*/ * @return */ public Bundle toBundle() { Bundle b = new Bundle(); b.putString("name", name); b.putInt("rows", rows); b.putInt("columns", columns); b.putFloat("scale", scale); b.putFloat("xOff", xOff); b.putFloat("yOff", yOff); for (int idxRow = 0; idxRow < rows; idxRow++) { for (int idxCol = 0; idxCol < columns; idxCol++) { if (tilePaths[idxRow][idxCol] != null) { b.putString("paths_" + idxRow + "_" + idxCol, tilePaths[idxRow][idxCol]); b.putByte("angles_" + idxRow + "_" + idxCol, tileAngles[idxRow][idxCol]); } } } return b; }
From source file:net.redwarp.android.app.githubcount.ProjectDetailFragment.java
public static ProjectDetailFragment newInstance(String user, String repository) { ProjectDetailFragment fragment = new ProjectDetailFragment(); Bundle args = new Bundle(); args.putString("user", user); args.putString("repository", repository); fragment.setArguments(args);/* w ww . ja va 2 s. c om*/ return fragment; }