- List<T>的Bean对象,Bean类实现Serializable接口,(如果包含其他bean类也需要实现)
public class DogBo implements Serializable {
}
- Activity跳转传递参数
List<DogBo > dogList = new ArrayList<>();
Intent intent = new Intent(this, OneActivity.class);
intent.putExtra("dog", (Serializable) dogList );
startActivity(intent);
- 目标Activity接受数据
Intent intent = getIntent();
List<DogBo > dogList = (List<DogBo>) intent.getSerializableExtra("dog");
网友评论