zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    TCP 基础知识
    Spring Boot 实战 —— 日志框架 Log4j2 SLF4J 的学习
    MySQL 实战笔记
    Java 基础
    RPM 包的构建
    RPM 包的构建
    9. 桶排序
    8. 基数排序
    7. 计数排序
    6. 快速排序
  • 原文地址:https://www.cnblogs.com/yue31313/p/7472791.html
Copyright © 2011-2022 走看看