Android开发之页面跳转传递list集合
这篇随笔这里详细记录两个activity之间如何传递list集合中的数据。
1、首先要对javabean进行序列化处理,即实现Serializable。
package com.anhua.bean; import java.io.Serializable; public class YunDanBean implements Serializable{
private String yunhao;// 承运号
private String huohao;// 货号
private String hwpm;// 品名 public String getYunhao() {
return yunhao;
} public void setYunhao(String yunhao) {
this.yunhao = yunhao;
} public String getHuohao() {
return huohao;
} public void setHuohao(String huohao) {
this.huohao = huohao;
} public String getHwpm() {
return hwpm;
} public void setHwpm(String hwpm) {
this.hwpm = hwpm;
}
}
2、页面跳转,发送list数据
List<YunDanBean> listdetail = new ArrayList<YunDanBean>();
Intent intent = new Intent(WayBillActivity.this, WayBillMessage.class);
intent.putExtra("listdetail", (Serializable) listdetail);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
3、另一个页面接受数据
yundanList = (List<YunDanBean>) getIntent().getSerializableExtra("listdetail");
通过上面几个步骤即可完成两个activity之间传递list集合了。
Android开发之页面跳转传递list集合的更多相关文章
- .Net程序猿玩转Android开发---(11)页面跳转
在不论什么程序开发中,都会遇到页面之间跳转的情况,Android开发也不例外.这一节,我们来认识下Android项目中如何进行页面跳转.页面跳转分为有參数和无參数页面跳转,已经接受还有一个页面的返回值 ...
- [Android应用开发] 04.页面跳转和数据传输
*:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...
- [转] 微信小程序 页面跳转 传递参数
本文转自:http://blog.csdn.net/qq_31383345/article/details/52795212 微信小程序的页面跳转,页面之间传递参数笔记. CSDN微信小程序开发专栏, ...
- Android开发 navigation的跳转动画实现
前言 此篇博客只简短的介绍navigation如何添加跳转页面的动画属性,如果你还为接触了解过navigation.建议你看我另一篇博客Android开发 navigation入门详解 创建动画xml ...
- 关于在Android中Activity页面跳转的方法
一.无返回结果的页面跳转 1.创建两个类FActivity.java和SActivity.java 2.创建两个layout目录下的factivity.xml和sactivity.xml 3.在And ...
- Java web开发中页面跳转小技巧——跳转后新页面在新窗口打开
最近学习Java web,在学习过程中想实现一个需求,就是在jsp页面跳转的时候,希望跳转后的新页面在新窗口中打开, 而不是覆盖原来的页面,这个需求使我困惑了好长时间,后来通过大海捞针似的在网上寻找方 ...
- 微信小程序 页面跳转传递数据
点击view 跳转页面 <view class="album_image" data-album-obj="{{item}}" bindtap=" ...
- 静态页面开发JS页面跳转加密解密URL和参数
页面跳转加密URL地址参数传递 window.location.href="foot.html?"+"good="+encodeURI(encodeURI(go ...
- jQuery Mobile学习之grid、等待显示的ajax效果、页面跳转、页面跳转传递参数等(二)
Index.cshtml <!-- Start of second page --> <section data-role="page" id="bar ...
随机推荐
- linux查看进程启动的时间点
ps -ef |grep xxx # 先查找进程pid ps -wo pid,lstart -p {pid}
- Hbase Filter过滤器查询详解
过滤器查询 引言:过滤器的类型很多,但是可以分为两大类——比较过滤器,专用过滤器 过滤器的作用是在服务端判断数据是否满足条件,然后只将满足条件的数据返回给客户端: hbase过滤器的比较运算符: LE ...
- Spring+SpringMVC+Mybatis+Maven+CXF+WebService整合之服务端
WebService服务端项目结构: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="h ...
- 使用Java监控工具出现 Can't attach to the process
问题重现 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ➜ jinfo -flags 3032 Attaching ...
- select函数与I/O多路转接
select函数与I/O多路转接 相作大家都写过读写IO操作的代码,例如从socket中读取数据可以使用如下的代码: while( (n = read(socketfd, buf, BUFSIZE) ...
- 反序列化和序列化xml使用反射处理节点的属性
当一个xml中有大量的属性XmlAttribute需要序列化和反序列化,通常需要复制粘贴大量的如下代码,显得很丑陋,而且容易出错: XmlAttribute attr = Doc.CreateAttr ...
- java.lang.Integer源码浅析
Integer定义,final不可修改的类 public final class Integer extends Number implements Comparable<Integer> ...
- 优秀WordPress版微信小程序推荐(二)
随着使用WordPress版微信小程序的用户越来越多,其中涌现不少优秀的小程序,无论UI设计还是功能上都远远超过我开源的程序.这次是推荐第二批优秀Wordpress版微信小程序,希望有更多的小程序的爱 ...
- Chapter4 复杂度分析(下):浅析最好,最坏,平均,均摊时间复杂度
四个复杂度分析: 1:最好情况时间复杂度(best case time complexity) 2:最坏情况时间复杂度(worst case time complexity) 3:平均情况时间复杂度( ...
- (转)cenntos 安装mongodb
转自 https://www.cnblogs.com/layezi/p/7290082.html 安装前注意: 此教程是通过yum安装的.仅限64位centos系统 安装步骤: 1.创建仓库文件: 1 ...