android 传递 类对象 序列化 Serializable
public class Song implements Serializable { /** * */ private static final long serialVersionUID = 6419921245498371442L; String uri; String songname; String author; boolean isCheck; public Song(String uri,String songname, String author) { this.uri = uri; this.songname = songname; this.author = author; } }
private void go2play() { ArrayList<Song> newlist = new ArrayList<Song>(); for (int i = 0; i < list.size(); i++) { if (list.get(i).isCheck) { newlist.add(list.get(i)); } } Intent intent = new Intent(this, Main.class); Bundle b = new Bundle(); b.putSerializable("list", newlist); intent.putExtras(b); startActivity(intent); }
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha