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.miz.mizuu.fragments.CoverSearchFragment.java

public static CoverSearchFragment newInstance(String tmdbId, String json, String baseUrl) {
    CoverSearchFragment pageFragment = new CoverSearchFragment();
    Bundle b = new Bundle();
    b.putString("tmdbId", tmdbId);
    b.putString("json", json);
    b.putString("baseUrl", baseUrl);
    pageFragment.setArguments(b);/*w  w  w.  j av  a2  s . c  o m*/
    return pageFragment;
}

From source file:com.facebook.internal.FacebookWebFallbackDialog.java

public static boolean presentWebFallback(final Context context, String dialogUrl, String applicationId,
        final FacebookDialog.PendingCall appCall, final FacebookDialog.Callback callback) {
    if (Utility.isNullOrEmpty(dialogUrl)) {
        return false;
    }//  w w  w .ja  va  2s.c  o m

    String redirectUrl = String.format("fb%s://bridge/", applicationId);

    // Show the webdialog.
    FacebookWebFallbackDialog fallbackWebDialog = new FacebookWebFallbackDialog(context, dialogUrl,
            redirectUrl);
    fallbackWebDialog.setOnCompleteListener(new WebDialog.OnCompleteListener() {
        @Override
        public void onComplete(Bundle values, FacebookException error) {
            Intent dummyIntent = new Intent();
            dummyIntent.putExtras(values == null ? new Bundle() : values);
            FacebookDialog.handleActivityResult(context, appCall, appCall.getRequestCode(), dummyIntent,
                    callback);
        }
    });

    fallbackWebDialog.show();
    return true;
}

From source file:com.clover.sdk.v3.entitlements.Entitlements.java

public boolean isAllowed(String entitlement) {
    Bundle extras = new Bundle();
    extras.putString(EXTRA_ENTITLEMENT, entitlement);
    Bundle result = context.getContentResolver().call(getAuthorityUri(), METHOD_IS_ALLOWED, null, extras);
    if (result == null) {
        return false;
    }/*from  w w  w  .j  a  v  a 2  s  .com*/
    return result.getBoolean(EXTRA_ALLOWED, false);
}

From source file:com.foxykeep.datadroidpoc.data.operation.AuthenticationOperation.java

@Override
public Bundle execute(Context context, Request request) throws ConnectionException, DataException {
    NetworkConnection networkConnection = new NetworkConnection(context, WSConfig.WS_AUTHENTICATION_URL);
    if (request.getBoolean(PARAM_WITH_AUTHENTICATE)) {
        networkConnection.setCredentials(new UsernamePasswordCredentials(LOGIN, PASSWD));
    }//  w  w  w  . j a v a 2s  . c o m
    ConnectionResult result = networkConnection.execute();

    Bundle bundle = new Bundle();
    bundle.putString(PoCRequestFactory.BUNDLE_EXTRA_AUTHENTICATION_RESULT, result.body);
    return bundle;
}

From source file:it.scoppelletti.mobilepower.app.HelpDialogFragment.java

/**
 * Istanzia un frammento./*ww  w . j a  va 2 s  .co  m*/
 * 
 * @param  mode    Modalità.
 * @param  titleId Identificatore della risorsa del titolo.
 * @param  textId  Identificatore della risorsa del testo.
 * @param  prefKey Chiave della preferenza che indica se la Guida è
 *                 già stata visualizzata.
 * @return         Frammento.
 */
public static HelpDialogFragment newInstance(int mode, int titleId, int textId, String prefKey) {
    Bundle args;
    HelpDialogFragment fragment;

    if (StringUtils.isBlank(prefKey)) {
        throw new NullPointerException("Argument prefKey is null.");
    }

    args = new Bundle();
    args.putInt(HelpDialogFragment.ARG_MODE, mode);
    args.putInt(HelpDialogFragment.ARG_TITLEID, titleId);
    args.putInt(HelpDialogFragment.ARG_TEXTID, textId);
    args.putString(HelpDialogFragment.ARG_PREFKEY, prefKey);

    fragment = new HelpDialogFragment();
    fragment.setArguments(args);

    return fragment;
}

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

public static CollectionCoverSearchFragment newInstance(String collectionId, String json, String baseUrl) {
    CollectionCoverSearchFragment pageFragment = new CollectionCoverSearchFragment();
    Bundle b = new Bundle();
    b.putString("collectionId", collectionId);
    b.putString("json", json);
    b.putString("baseUrl", baseUrl);
    pageFragment.setArguments(b);//from w  ww  . ja v a 2s .co  m
    return pageFragment;
}

From source file:com.tapcentive.sdk.actions.TapMessageFragment.java

/**
 * New instance./*from   www . ja  v  a2 s  .c o m*/
 * 
 * @return the tap message fragment
 */
public static TapMessageFragment newInstance() {
    _fragment = new TapMessageFragment();
    Bundle args = new Bundle();

    _fragment.setArguments(args);
    return _fragment;
}

From source file:behsaman.storytellerandroid.ScreenSlidePageFragment.java

/**
 * Factory method for this fragment class. Constructs a new fragment for the given page number.
 *///www . j a va  2s . com
public static ScreenSlidePageFragment create(PieceModel model, STORY_TYPE type, Context parentCon) {
    parentContext = parentCon;
    ScreenSlidePageFragment fragment = new ScreenSlidePageFragment();
    Bundle args = new Bundle();
    args.putSerializable(ARG_MODEL, model);
    args.putString(ARG_TYPE, type.toString());
    fragment.setArguments(args);
    return fragment;
}

From source file:com.savvywits.wethepeople.RESTService.java

@Override
protected void onHandleIntent(Intent intent) {
    Bundle extras = intent.getExtras();//from   w ww.j  ava2s.c om
    ResultReceiver receiver = extras.getParcelable("receiver");
    String data = extras.getString("zipcode");
    String url = ZIP_CODE_BASE + data;

    Bundle bundle = new Bundle();
    receiver.send(STATUS_RUNNING, Bundle.EMPTY);
    try {
        String json = EntityUtils.toString(new DefaultHttpClient().execute(new HttpGet(url)).getEntity());

        if (!validateJSON(json)) {
            receiver.send(STATUS_ERROR, Bundle.EMPTY);
        } else {
            bundle.putString("rest_result", json);
            receiver.send(STATUS_FINISHED, bundle);
        }
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (Exception e) {
        bundle.putString(Intent.EXTRA_TEXT, e.toString());
        receiver.send(STATUS_ERROR, bundle);
    }
}

From source file:com.thevelopment.poc.Fragments.FirstFragment.java

public static FirstFragment newInstance(String text) {

    FirstFragment f = new FirstFragment();
    Bundle b = new Bundle();
    b.putString("msg", text);

    f.setArguments(b);/*  w  ww . ja  va 2  s  .com*/

    return f;
}