Example usage for android.os Bundle putInt

List of usage examples for android.os Bundle putInt

Introduction

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

Prototype

public void putInt(@Nullable String key, int value) 

Source Link

Document

Inserts an int value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.antew.redditinpictures.library.service.RESTService.java

public void onRequestFailed(Intent result, int statusCode) {
    Bundle args = new Bundle();
    args.putInt(EXTRA_STATUS_CODE, statusCode);
    result.putExtra(EXTRA_BUNDLE, args);

    onRequestComplete(result);/*from  w  w w  .  j a v  a  2s .  c o m*/
}

From source file:com.rjfun.cordova.qq.QQPlugin.java

public boolean share(JSONObject args) {
    Log.d(LOGTAG, "share");

    if (!this.inited) {
        this.mTencent = Tencent.createInstance(this.appId, this.getActivity().getApplicationContext());
        this.inited = true;
    }/*  w ww.j a  v a 2s. co  m*/

    String message = args.optString(OPT_MESSAGE);
    String subject = args.optString(OPT_SUBJECT);
    String image = args.optString(OPT_IMAGE);
    String url = args.optString(OPT_URL);

    final boolean qqZone = args.optBoolean(OPT_QQZONE);
    final Bundle params = new Bundle();
    if (qqZone) {
        params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
        params.putString(QzoneShare.SHARE_TO_QQ_TITLE, subject);
        params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, message);
        params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, url);
        ArrayList<String> images = new ArrayList<String>();
        images.add(image);
        params.putStringArrayList(QQShare.SHARE_TO_QQ_IMAGE_URL, images);
        params.putString(QzoneShare.SHARE_TO_QQ_APP_NAME, this.appName + "" + this.appId);

    } else {
        params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
        params.putString(QQShare.SHARE_TO_QQ_TITLE, subject);
        params.putString(QQShare.SHARE_TO_QQ_SUMMARY, message);
        params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, url);
        params.putString(QzoneShare.SHARE_TO_QQ_IMAGE_URL, image);
        params.putString(QQShare.SHARE_TO_QQ_APP_NAME, this.appName + "" + this.appId);
        //params.putInt(QQShare.SHARE_TO_QQ_EXT_INT,  0);
    }

    final Activity activity = this.getActivity();
    final IUiListener qqDelegate = this;
    activity.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            if (qqZone) {
                mTencent.shareToQzone(activity, params, qqDelegate);
            } else {
                mTencent.shareToQQ(activity, params, qqDelegate);
            }
        }
    });

    return true;
}

From source file:com.brodev.socialapp.view.MarketPlaceDetail.java

/** Called when the activity is first created. */
@Override/*from  w w  w.  ja  va 2s . c o  m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.market_place_content_view);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Bundle bundle = getIntent().getExtras();
    marketPlace = (MarketPlace) bundle.get("marketplace");

    phraseManager = new PhraseManager(getApplicationContext());
    user = (User) getApplicationContext();
    colorView = new ColorView(getApplicationContext());
    this.imageGetter = new ImageGetter(getApplicationContext());

    if (android.os.Build.VERSION.SDK_INT > 9) {
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
    }

    if (marketPlace.getTime_stamp().equals("0")) {
        this.getMarketPlaceAdapter();
    }

    getSupportActionBar().setTitle(phraseManager.getPhrase(getApplicationContext(), "marketplace.marketplace"));
    initView();

    // get comment fragment
    Bundle comment = new Bundle();
    comment.putString("type", "marketplace");
    comment.putInt("itemId", marketPlace.getListing_id());
    comment.putInt("totalComment", marketPlace.getTotal_comment());
    comment.putInt("total_like", marketPlace.getTotal_like());
    comment.putBoolean("no_share", false);
    comment.putBoolean("is_liked", marketPlace.getIs_liked());
    comment.putBoolean("can_post_comment", marketPlace.getCan_post_comment());

    CommentFragment commentFragment = new CommentFragment();
    commentFragment.setArguments(comment);
    getSupportFragmentManager().beginTransaction().add(R.id.commentfragment_wrap, commentFragment).commit();
}

From source file:com.project.binbinfu.the_city.MainActivity.java

@Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
    // When the given tab isselected, show the tabcontents in the
    // //container view.
    Fragment fragment3 = null;/*  www .j a va  2s  .c  o  m*/
    Fragment fragment1 = null;
    Fragment fragment2 = null;
    switch (tab.getPosition()) {
    case 0:
        // The first is Selected
        if (fragment1 == null) {
            fragment1 = new SelectedFragment();
        }
        getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment1).commit();
        break;
    case 1:
        // The second is Search
        if (fragment2 == null) {
            fragment2 = new SearchFragment();
        }
        getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment2).commit();
        Intent intent = new Intent(MainActivity.this, Search.class);

        MainActivity.this.startActivity(intent);
        break;
    case 2:
        // The third is My City
        if (fragment3 == null) {
            fragment3 = new MyCityFragment();
            Bundle args = new Bundle();
            args.putInt(MyCityFragment.ARG_SECTION_NUMBER, 3);
            fragment3.setArguments(args);
        }
        getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment3).commit();
        Intent nearby = new Intent(MainActivity.this, Nearby.class);

        MainActivity.this.startActivity(nearby);
        break;
    default:
        break;
    }
}

From source file:com.github.chenxiaolong.dualbootpatcher.switcher.MbtoolTaskOutputFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(EXTRA_IS_RUNNING, mIsRunning);
    outState.putInt(EXTRA_TASK_ID, mTaskId);
}

From source file:es.uniovi.imovil.fcrtrainer.HexadecimalExerciseFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean("tohex", tohex);
    outState.putInt("numbertoconvert", numberToConvert);
}

From source file:de.stadtrallye.rallyesoft.ConnectionAssistantActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putInt(Std.STEP, step);
    outState.putString(Std.SERVER, (server != null) ? server.serialize() : null);
    outState.putString(Std.NAME, name);/*  ww  w.j  av  a2 s  .c o m*/
}

From source file:app.hacked.ChallengeListFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    if (mActivatedPosition != ListView.INVALID_POSITION) {
        // Serialize and persist the activated item position.
        outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition);
    }/*from ww  w . j a  v a  2  s. co  m*/
}