一、简单数值传递
1、MainActivity
protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {//startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baidu.com")));Intent i=new Intent(MainActivity.this,NewActivity.class);i.putExtra("data","我是要传递的字符串");startActivity(i);}});}
2、NewActivity
private TextView T;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);