I haven't sorted out what I used in the past. Now I want to sort it out for ease of use:
Generally, the interface returns a list, which cannot be passed directly. It is defined as static and occupies too much memory. Therefore, we can define it as a common variable and pass it through itent, in this case, we must serialize the custom model and inherit the parcelable interface. Paste directlyCode:
Public class citylistinfo implements parcelable;
List <citylistinfo> citylistinfos = new arraylist <citylistinfo> ();
List <Map <string, jsondataholder> hotcitylist = jsonparcel
. Get ("data"). getjsonobjectmap (). Get ("hotcitylist ")
. Getlist ();
If (null! = Hotcitylist & hotcitylist. Size ()> 0)
{
For (INT I = 0; I {
Citylistinfo CI = new citylistinfo ();
CI. cityid = hotcitylist. Get (I). Get ("cityid"). getstring ();
CI. citypinyin = hotcitylist. Get (I). Get ("pinyin ")
. Getstring ();
CI. cityname = hotcitylist. Get (I). Get ("cityname ")
. Getstring ();
Citylistinfos. Add (CI );
}
}
Mcitylistinfo = (list <citylistinfo>) msg. OBJ;
Intent. putparcelablearraylistextra ("cityname ",
(Arraylist <citylistinfo>) mcitylistinfo );
Arraylist <citylistinfo> cityinfos = This. getintent ()
. Getparcelablearraylistextra ("cityname ");
This is understandable.