Although knowledge is very basic, but I think whether it is difficult, even if very simple knowledge, timely written to the accumulation of knowledge is good. Write about intent data transfer today.
Send side:
Create intentintent Intent = new Intent ();//Put the required content into Intentintent.putextra ("id", waitinfo.id); Intent.putextra (" Warnning_star ", Warnning_star); Intent.putextra (" Fengxlx ", WAITINFO.FENGXLX); Intent.putextra (" Chehao ", Waitinfo.chehao); Intent.putextra ("Content", waitinfo.content); Intent.putextra ("Time", waitinfo.time);// Set the Activityintent.setclass to start (Getactivity (), zaituyujing_fengxcl_xiangxxx_activity.class);//Jump StartActivity ( Intent);
Receiving end:
Receive Intentintent intent = getintent ();//Take out bundled data bundle bundle = Intent.getextras ();//extract the required content from the data according to key int index = Integer.parseint (bundle.getstring ("id")); String Chehao = bundle.getstring ("Chehao"); String content = bundle.getstring ("content"); String time = bundle.getstring ("Time");
This article is from the "Mobile Platform Development" blog, make sure to keep this source http://liuxudong1001.blog.51cto.com/10877072/1720155
Intent data transfer