- List<T>的Bean對象异逐,Bean類實(shí)現(xiàn)Serializable接口,(如果包含其他bean類也需要實(shí)現(xiàn))
public class DogBo implements Serializable {
}
- Activity跳轉(zhuǎn)傳遞參數(shù)
List<DogBo > dogList = new ArrayList<>();
Intent intent = new Intent(this, OneActivity.class);
intent.putExtra("dog", (Serializable) dogList );
startActivity(intent);
- 目標(biāo)Activity接受數(shù)據(jù)
Intent intent = getIntent();
List<DogBo > dogList = (List<DogBo>) intent.getSerializableExtra("dog");