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.phicomm.account.operator.UploadContactOperation.java

@Override
public Bundle execute(Context context, Request request) {
    //read upload table
    //xml/*from w  ww  . jav  a  2  s . c  om*/
    //upload to service   -- ok

    String ssession_id = null;
    String user_key = null;
    String user_name = null;
    String xmlDoc = null;
    String sync_time = null;
    Bundle resultData = new Bundle();
    Cursor persionCursor = context.getContentResolver().query(Provider.PersonColumns.CONTENT_URI, null, null,
            null, null);
    if (persionCursor != null) {
        if (persionCursor.moveToFirst()) {
            ssession_id = persionCursor
                    .getString(persionCursor.getColumnIndex(Provider.PersonColumns.JSSESSIONID));
            user_key = persionCursor.getString(persionCursor.getColumnIndex(Provider.PersonColumns.USER_KEY));
            user_name = persionCursor.getString(persionCursor.getColumnIndex(Provider.PersonColumns.NAME));
            sync_time = persionCursor.getString(persionCursor.getColumnIndex(Provider.PersonColumns.SYNC_TIME));
        }
        persionCursor.close();
    }
    //mode xmlDoc.
    ContactUpload upload = new ContactUpload();
    UploadDataOperate uploadOperate = new UploadDataOperate(context);
    Log.i("ss", "_____upload :" + uploadOperate.judgeUploadDataExist());
    if (uploadOperate.judgeUploadDataExist()) {
        ArrayList<Contact> updataValues = upload.getUploadContactList(context);
        xmlDoc = NetworkUtilities.modContactToXml(updataValues, user_name, user_key, sync_time);
    }
    String url = WSConfig.WS_SYNC_CONTACT_URL + ssession_id;
    NetworkConnection networkConnection1 = new NetworkConnection(context, url);
    ArrayList<BasicNameValuePair> parameterList = new ArrayList<BasicNameValuePair>();
    BasicNameValuePair value = new BasicNameValuePair("XML", xmlDoc);
    parameterList.add(value);
    networkConnection1.setParameters(parameterList);
    try {
        ConnectionResult result = networkConnection1.execute();
        resultData.putString("result", result.body);
        Log.i("ss", "________________________________result.body:" + result.body);
    } catch (ConnectionException e) {
        e.printStackTrace();
    }
    Log.i("ss", "_______________________________________OK");
    return resultData;
}

From source file:com.del7a.capptain.Capptain.java

public void initialize(CordovaInterface _cordova, CordovaWebView webView) {

    CordovaActivity Activity = (CordovaActivity) _cordova.getActivity();
    final String invokeString = Activity.getIntent().getDataString();
    if (invokeString != "" && invokeString != null) {
        lastRedirect = invokeString;//from  www  .jav a 2s  .c  o  m
        System.out.println("Preparing Redirect to " + lastRedirect);
    }
    super.initialize(_cordova, webView);
    cordova = _cordova;

    Bundle b = new Bundle();
    b.putString("CDVCapptainVersion", pluginVersion);
    CapptainAgent.getInstance(cordova.getActivity()).sendAppInfo(b);
}

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

/**
 * Returns a new instance of this fragment for the given section number.
 *
 * @param sectionNumber the section number
 * @return the fragment/*from   w ww .  j av a2  s .  com*/
 */
@NonNull
public static BusFragment newInstance(final int sectionNumber) {
    final BusFragment fragment = new BusFragment();
    final Bundle args = new Bundle();
    args.putInt(ARG_SECTION_NUMBER, sectionNumber);
    fragment.setArguments(args);
    return fragment;
}

From source file:com.scrachx.foodfacts.checker.ui.history.HistoryFragment.java

public static HistoryFragment newInstance(String grade) {
    Bundle args = new Bundle();
    args.putString("grade", grade);
    HistoryFragment fragment = new HistoryFragment();
    fragment.setArguments(args);//from w ww .j ava2s.  c  om
    return fragment;
}

From source file:com.ryan.ryanreader.fragments.UserProfileDialog.java

public static UserProfileDialog newInstance(final String user) {

    final UserProfileDialog dialog = new UserProfileDialog();

    final Bundle args = new Bundle();
    args.putString("user", user);
    dialog.setArguments(args);/*w ww . j  av  a2s .c o m*/

    return dialog;
}

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

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

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

public static ActorBrowserFragment newInstance(String movieId) {
    ActorBrowserFragment pageFragment = new ActorBrowserFragment();
    Bundle bundle = new Bundle();
    bundle.putString("movieId", movieId);
    pageFragment.setArguments(bundle);/*from w  w  w .ja va 2s.c  o m*/
    return pageFragment;
}

From source file:com.madgag.agit.BlobViewFragment.java

public static BlobViewFragment newInstance(File gitdir, String revision, String path) {
    BlobViewFragment f = new BlobViewFragment();

    Bundle args = new Bundle();
    args.putString(GITDIR, gitdir.getAbsolutePath());
    args.putString(UNTIL_REVS, revision);
    args.putString(PATH, path);/*from ww  w. ja  v a  2  s  .com*/
    f.setArguments(args);

    return f;
}

From source file:com.brennasoft.facebookdashclockextension.fbclient.InboxRequest.java

public InboxResponse execute(Session session) {
    InboxResponse inboxResponse = new InboxResponse();
    if (session.isOpened() && session.getPermissions().contains("read_mailbox")) {
        Bundle parameters = new Bundle();
        parameters.putString("q", q);
        Request request = new Request(session, "/fql", parameters, HttpMethod.GET);
        Response response = request.executeAndWait();
        FacebookRequestError error = response.getError();
        if (error == null) {
            inboxResponse = parseResponse(response);
        }/*from   w w  w.j a  v  a 2 s  . com*/
    }
    return inboxResponse;
}

From source file:com.facebook.share.internal.WebDialogParameters.java

public static Bundle create(GameRequestContent gameRequestContent) {
    Bundle webParams = new Bundle();

    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_MESSAGE,
            gameRequestContent.getMessage());
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_TO, gameRequestContent.getTo());
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_TITLE, gameRequestContent.getTitle());
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_DATA, gameRequestContent.getData());
    if (gameRequestContent.getActionType() != null) {
        Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_ACTION_TYPE,
                gameRequestContent.getActionType().toString().toLowerCase(Locale.ENGLISH));
    }/*from  w ww  . ja  v a2s  .co m*/
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_OBJECT_ID,
            gameRequestContent.getObjectId());
    if (gameRequestContent.getFilters() != null) {
        Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_FILTERS,
                gameRequestContent.getFilters().toString().toLowerCase(Locale.ENGLISH));
    }
    Utility.putCommaSeparatedStringList(webParams, ShareConstants.WEB_DIALOG_PARAM_SUGGESTIONS,
            gameRequestContent.getSuggestions());
    return webParams;
}