1

ft h&fWH. fcttJfJB^IfiifJ&itiRI**

IkWKW" ffl^WJtffflr'W-t-Ma^o iMmfcJftinH 15-9

5. «WWifcftlHB

Ml' intent.setClass(Auth.this, BoxActivty.class) ^ii'-i, ftjtfJfJ'Jf —MftftJlfli. Pft YOBC)

l-.fKj^Art-^. SMriijifijW UI MJ&J. mm®& BoxActivty q'Mljr'MffttJN YOBO API ttHftltt&U. ■<)M}jxK.lil\ Ko iWftfitt OnCreate rt^M. Kftf^nTflW:

/** Called when the activity is first created. +/ (^Override public void onCreate(Bundle savedlnstanceState) { super.onCreate(savedlnstanceState); setContentView(R.J ayout.box); set Title ("YOBO: M^ft^");

session = getSessionlnPerence(); user = new User(session);

ListView itemlist = (ListView) findViewByld (R. id. itemlist) ; ArrayAdapter<Box> adapter = new ArrayAdapter<Box>(this, android.R.layout.simple list item 1, user.getAllBoxes());

itemlist.setAdapter(adapter);

itemlist.setOnltemClickListener(this);

itemlist.setSelection(0); )

ftPi:««'^, fiftim getSessionlnPerenceO^ITM seesion key, j&JS iBffil new User (session) User user, «Jg^ffl7 Android ig-fltlMiJ&XjjffeftKM^V*. &

ftlt«t5«Iil User (seesion) M&3I, User.java . iWiaiTW/N:

public class User ( public final String TAG "User"; private String nickname = nulls-private String created date nulls-private String homepage = nulls-private String love_sigers = nulls-private int _boxes_count = 0; private int stations count 0; private List<Box> _boxes_list; private List<Station> stations_list;

public class Box ( private String id = null; private String name = nulls-private String created date = nulls-private int itemcount ~ 0; private List<Song> itemlist;

public Box() { itemlist = new Vector<Song>(0);

0 0

Post a comment