说明:需要把list序列化,然后传递接收
另外,新建了一个activity,需要在清单文件里面注册
(1)bean类
package com.example.myapplication19;
import java.io.Serializable;
public class StudentBean implements Serializable {
String name;
int age;
public StudentBean(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "StudentBean{" +
"name='" + name + '\'' +
", age=" + age +
'}';
}
}
(2)主界面