Android 开发-Intent传递普通字符串

假设A传递id到B中 

ActivityA:

    Intent intent=new Intent();
    intent.setClass(ActivityA.this,ActivityB.class);
    intent.putExtra("id", "值");
    startActivity(intent);

ActivityB:

  Intent intent=getIntent();
  String stringValue
=intent.getStringExtra("id");

 

你可能感兴趣的:(Android 开发)