一、实验内容:
从MainActivity跳转到SecondActivity,当从SecondActivity向MainActivity跳转时,传递并显示数据
二、代码
(1)MainActivity
package cn.bzu.tong.tiaozhuan;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity
{
private Button btnClick1;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnClick1=(Button) findViewById(R.id.btnClick1);
btnClick1.setOnClickListener(new OnClickListener()
{
public void onClick(View view)
{
Intent intent = new Intent(MainAct