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:edu.rit.csh.androidwebnews.PostPagerAdapter.java

@Override
public Fragment getItem(int i) {
    PostFragment fragment = new PostFragment(rootThread.getThisThread(i), i + 1, getCount());
    Bundle args = new Bundle();
    fragment.setArguments(args);//from w  w w  .j av  a2s.co m

    fragments[i] = fragment;

    return fragment;
}

From source file:com.comu.android.StreamJsHandler.java

/**
 * Update the status and render the resulting status at the
 * top of the stream./*from w  w w.j av a 2s  .c o m*/
 *  
 * @param message
 */
public void updateStatus(final String message) {
    AsyncFacebookRunner fb = getFb();
    Bundle params = new Bundle();
    params.putString("message", message);
    fb.request("me/feed", params, "POST", new AsyncRequestListener() {

        public void onComplete(JSONObject obj, final Object state) {
            String html;
            try {
                html = renderStatus(obj, message);
                html = html.replace("'", "\\\'");
                callJs("onStatusUpdated('" + html + "');");
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }, null);
}

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

private Bundle stringToBundle(String _param) {
    JSONObject jObj;// w  ww. ja v a 2s  . co  m
    try {
        jObj = new JSONObject(_param);
        Bundle b = new Bundle();

        @SuppressWarnings("unchecked")
        Iterator<String> keys = jObj.keys();
        while (keys.hasNext()) {
            String key = keys.next();
            String val = jObj.getString(key);
            b.putString(key, val);
        }
        return b;

    } catch (JSONException e) {
        return null;
    }
}

From source file:it.gulch.linuxday.android.fragments.TrackScheduleListFragment.java

public static TrackScheduleListFragment newInstance(Day day, Track track) {
    TrackScheduleListFragment f = new TrackScheduleListFragment();
    Bundle args = new Bundle();
    args.putSerializable(ARG_DAY, day);/*from   ww  w  . ja  va2s  .  c om*/
    args.putSerializable(ARG_TRACK, track);
    f.setArguments(args);
    return f;
}

From source file:com.github.rutvijkumar.twittfuse.fragments.SearchTweetsFragment.java

public static SearchTweetsFragment newInstance(int page, String title, String query) {
    SearchTweetsFragment fragment = new SearchTweetsFragment();
    Bundle args = new Bundle();
    args.putInt("page", page);
    args.putString("title", title);
    args.putString("query", query);
    fragment.setArguments(args);/*from   w ww.  ja v a2  s . co m*/
    return fragment;
}

From source file:com.ubikod.capptain.android.sdk.reach.CapptainPoll.java

/**
 * Parse an announcement./*from  w  ww. j  a v a2s.  c  o  m*/
 * @param jid service that sent the announcement.
 * @param xml raw XML of announcement to store in SQLite.
 * @param root parsed XML root DOM element.
 * @throws JSONException if a parsing error occurs.
 */
CapptainPoll(String jid, String xml, Element root) throws JSONException {
    super(jid, xml, root);
    mAnswers = new Bundle();
    mQuestions = new JSONArray();
    NodeList questions = root.getElementsByTagNameNS(REACH_NAMESPACE, "question");
    for (int i = 0; i < questions.getLength(); i++) {
        Element questionE = (Element) questions.item(i);
        NodeList choicesN = questionE.getElementsByTagNameNS(REACH_NAMESPACE, "choice");
        JSONArray choicesJ = new JSONArray();
        for (int j = 0; j < choicesN.getLength(); j++) {
            Element choiceE = (Element) choicesN.item(j);
            JSONObject choiceJ = new JSONObject();
            choiceJ.put("id", choiceE.getAttribute("id"));
            choiceJ.put("title", XmlUtil.getText(choiceE));
            choiceJ.put("default", Boolean.parseBoolean(choiceE.getAttribute("default")));
            choicesJ.put(choiceJ);
        }
        JSONObject questionJ = new JSONObject();
        questionJ.put("id", questionE.getAttribute("id"));
        questionJ.put("title", XmlUtil.getTagText(questionE, "title", null));
        questionJ.put("choices", choicesJ);
        mQuestions.put(questionJ);
    }
}

From source file:com.gmail.at.faint545.fragments.HistoryFragment.java

public static HistoryFragment newInstance(Remote mRemote) {
    HistoryFragment self = new HistoryFragment();
    Bundle args = new Bundle();
    args.putParcelable("remote", mRemote);
    self.setArguments(args);//from w w  w  .java2s.co  m
    return self;
}

From source file:com.mifos.mifosxdroid.dialogfragments.loanaccountdisbursement.LoanAccountDisbursement.java

public static LoanAccountDisbursement newInstance(int loanAccountNumber) {
    LoanAccountDisbursement loanAccountDisbursement = new LoanAccountDisbursement();
    Bundle args = new Bundle();
    args.putInt(Constants.LOAN_ACCOUNT_NUMBER, loanAccountNumber);
    loanAccountDisbursement.setArguments(args);
    return loanAccountDisbursement;
}

From source file:com.zotfeed2.CardContentFragment.java

public static CardContentFragment newInstance(String request) {
    CardContentFragment fragment = new CardContentFragment();
    Bundle bundle = new Bundle();
    bundle.putString(COMMAND, request);/* ww  w.j a  v a 2  s .  c  o m*/
    fragment.setArguments(bundle);
    return fragment;
}

From source file:com.mifos.mifosxdroid.dialogfragments.loanchargedialog.LoanChargeDialogFragment.java

public static LoanChargeDialogFragment newInstance(int loanAccountNumber) {
    LoanChargeDialogFragment loanChargeDialogFragment = new LoanChargeDialogFragment();
    Bundle args = new Bundle();
    args.putInt(Constants.LOAN_ACCOUNT_NUMBER, loanAccountNumber);
    loanChargeDialogFragment.setArguments(args);
    return loanChargeDialogFragment;
}