• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
韩亚飞_yue31313_韩梦飞沙
未来的某一天你会觉得现在所做的,大部分很烂,小部分很好
博客园    首页    新随笔    联系   管理    订阅  订阅

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
posted @ 2017-09-04 17:27  韩梦飞沙_韩亚飞  阅读(232)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3