Example usage for android.os Bundle Bundle

List of usage examples for android.os Bundle Bundle

Introduction

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

Prototype

public Bundle() 

Source Link

Document

Constructs a new, empty Bundle.

Usage

From source file:com.ntsync.android.sync.activities.VerifyPaymentProgressDialog.java

/**
 * Creates a Verify Progress Dialog/*w  w  w .  j a  v  a2 s .  c o  m*/
 * 
 * @param userName
 * @param pwdSalt
 * @param authtoken
 * @return invisible Dialog
 */
public static VerifyPaymentProgressDialog newInstance(UUID selectedPriceId, String jsonProofOfPayment,
        String accountName) {
    VerifyPaymentProgressDialog dlg = new VerifyPaymentProgressDialog();
    Bundle args = new Bundle();
    args.putString(PARAM_PRICEID, selectedPriceId.toString());
    args.putString(PARAM_PROOFOFPAYMENT, jsonProofOfPayment);
    args.putString(PARAM_ACCOUNTNAME, accountName);
    dlg.setArguments(args);
    return dlg;
}

From source file:com.google.android.apps.authenticator.dataexport.Exporter.java

private static Bundle getAccountDbBundle(AccountDb accountDb) {
    List<String> accountNames = new ArrayList<String>();
    accountDb.getNames(accountNames);/*  w  w  w.j a  va2s  . c o  m*/

    Bundle result = new Bundle();
    int accountPosition = 0;
    for (String accountName : accountNames) {
        accountPosition++;
        Bundle account = new Bundle();
        account.putString("name", accountName);
        account.putString("encodedSecret", accountDb.getSecret(accountName));
        account.putInt("counter", accountDb.getCounter(accountName));
        AccountDb.OtpType accountType = accountDb.getType(accountName);
        String serializedAccountType;
        switch (accountType) {
        case HOTP:
            serializedAccountType = "hotp";
            break;
        case TOTP:
            serializedAccountType = "totp";
            break;
        default:
            throw new RuntimeException("Unsupported account type: " + accountType);
        }
        account.putString("type", serializedAccountType);
        result.putBundle(String.valueOf(accountPosition), account);
    }
    return result;
}

From source file:org.openhab.habdroid.ui.OpenHABDiscoveryInboxFragment.java

public static OpenHABDiscoveryInboxFragment newInstance(String baseUrl, String username, String password) {
    OpenHABDiscoveryInboxFragment fragment = new OpenHABDiscoveryInboxFragment();
    Bundle args = new Bundle();
    args.putString(ARG_USERNAME, username);
    args.putString(ARG_PASSWORD, password);
    args.putString(ARG_BASEURL, baseUrl);
    fragment.setArguments(args);/*from  w ww  . j  a  v a  2  s.  c  o  m*/
    return fragment;
}

From source file:fr.cph.chicago.core.fragment.BikeFragment.java

/**
 * Returns a new instance of this fragment for the given section number.
 *
 * @param sectionNumber the section number
 * @return the fragment//w w  w . ja  va 2 s . c  o m
 */
@NonNull
public static BikeFragment newInstance(final int sectionNumber) {
    final BikeFragment fragment = new BikeFragment();
    final Bundle args = new Bundle();
    args.putInt(ARG_SECTION_NUMBER, sectionNumber);
    fragment.setArguments(args);
    return fragment;
}

From source file:com.mifos.mifosxdroid.dialogfragments.chargedialog.ChargeDialogFragment.java

public static ChargeDialogFragment newInstance(int clientId) {
    ChargeDialogFragment chargeDialogFragment = new ChargeDialogFragment();
    Bundle args = new Bundle();
    args.putInt(Constants.CLIENT_ID, clientId);
    chargeDialogFragment.setArguments(args);
    return chargeDialogFragment;
}

From source file:com.mifos.mifosxdroid.online.ClientChargeFragment.java

public static ClientChargeFragment newInstance(int clientId, List<Charges> chargesList,
        boolean isParentFragmentAGroupFragment) {
    ClientChargeFragment fragment = new ClientChargeFragment();
    Bundle args = new Bundle();
    args.putInt(Constants.CLIENT_ID, clientId);
    fragment.setArguments(args);//from  w  ww. java2s.c  om
    fragment.setChargesList(chargesList);
    if (isParentFragmentAGroupFragment) {
        fragment.setInfiniteScrollEnabled(false);
    }
    return fragment;
}

From source file:com.krayzk9s.imgurholo.activities.ImageActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getActionBar() != null)
        getActionBar().setDisplayHomeAsUpEnabled(true);
    if (savedInstanceState == null) {
        Intent intent = getIntent();//  www .  ja  va  2s  .com
        Log.d("intent", intent.getExtras().getParcelable("id").toString());
        JSONObject id = ((JSONParcelable) intent.getExtras().getParcelable("id")).getJSONObject();
        try {
            if (id.has("is_album") && id.getBoolean("is_album")) {
                ImagesFragment fragment = new ImagesFragment();
                Bundle bundle = new Bundle();
                bundle.putString("imageCall", "3/album/" + id.getString("id"));
                bundle.putString("id", id.getString("id"));
                JSONParcelable data = new JSONParcelable();
                data.setJSONObject(id);
                bundle.putParcelable("albumData", data);
                fragment.setArguments(bundle);
                FragmentManager fragmentManager = getSupportFragmentManager();
                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
                fragmentTransaction.replace(R.id.frame_layout, fragment).commitAllowingStateLoss();
            } else {
                SingleImageFragment singleImageFragment = new SingleImageFragment();
                Bundle bundle = new Bundle();
                bundle.putBoolean("gallery", true);
                JSONParcelable data = new JSONParcelable();
                data.setJSONObject(id);
                bundle.putParcelable("imageData", data);
                singleImageFragment.setArguments(bundle);
                FragmentManager fragmentManager = getSupportFragmentManager();
                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
                fragmentTransaction.replace(R.id.frame_layout, singleImageFragment).commitAllowingStateLoss();
            }
        } catch (JSONException e) {
            Log.e("Error!", e.toString());
        }
    }
}

From source file:com.miz.mizuu.fragments.WebVideoFragment.java

public static WebVideoFragment newInstance(String type) {
    WebVideoFragment pageFragment = new WebVideoFragment();
    Bundle bundle = new Bundle();
    bundle.putString("type", type);
    pageFragment.setArguments(bundle);/*  w  w w .  ja  v  a  2s.c  o  m*/
    return pageFragment;
}

From source file:com.macmoim.pang.FoodListFragment.java

public static FoodListFragment GetInstance(int position) {
    //Construct the fragment
    FoodListFragment myFragment = new FoodListFragment();

    //New bundle instance
    Bundle args = new Bundle();

    //Passing in the Integer position of the fragment into the argument
    args.putInt("position", position);

    //Setting the argument of the fragment to be the position
    myFragment.setArguments(args);/* w  ww. ja va2s.  c  om*/

    REQ_TAG += position;

    //Return the fragment
    return myFragment;
}

From source file:com.linkedin.android.eventsapp.EventFragment.java

public static final EventFragment newInstance(Event event) {
    EventFragment f = new EventFragment();
    Bundle bdl = new Bundle();
    bdl.putString(EXTRA_EVENT_NAME, event.getEventName());
    bdl.putInt(EXTRA_PICTURE_ID, event.getImageResourceId());
    bdl.putString(EXTRA_EVENT_LOCATION, event.getEventLocation());
    bdl.putLong(EXTRA_EVENT_DATE, event.getEventDate());
    bdl.putBoolean(EXTRA_EVENT_ATTENDING, event.getIsAttending());
    bdl.putParcelableArray(EXTRA_EVENT_ATTENDEES, event.getEventAttendees());
    f.setArguments(bdl);/*from  ww  w .  j  av a  2s.  c o  m*/
    return f;
}