java - how to send arraylist<hashmap<string, string>> value from fragmentactivity to fragment for listview -
please me this.. please tell me how send arraylist> value fragmentactivity fragment value have create listview using simple adapter.. before have send value activity fragmentactivity using putextra(string, serializable) fetching in fragmentactivity using getintent.getserializable extra..but after don't know hwo use value fragment list view..
this mainactivity sending value
@override protected void onpostexecute(void result) { // todo auto-generated method stub super.onpostexecute(result); progress.dismiss(); intent = new intent(mainactivity.this, pager.class); i.putextra("datalist", datatlist); //toast.maketext(getapplicationcontext(), "bundle value" +datatlist, toast.length_long).show(); startactivity(i);
this pager extends fragmentactivity
intent intent = getintent(); data = (arraylist<hashmap<string, string>>) intent.getserializableextra("datalist"); toast.maketext(getapplicationcontext(), "bundle value in pager" +data, toast.length_long).show();
now want use "data value " in fragment of pager listview please explain how..
public class tabspageradapter extends fragmentpageradapter { public tabspageradapter(fragmentmanager fm) { super(fm); } @override public fragment getitem(int index) { switch (index) { case 0: // top rated fragment activity return new topratedfragment(); case 1: // games fragment activity return new gamesfragment(); case 2: // movies fragment activity return new moviesfragment(); } return null; } @override public int getcount() { // item count - equal number of tabs return 3; }
}
i think should create class .
public class data { public static final arraylist<hashmap<string,string>> map; }
when redirect other page
intent = new intent(mainactivity.this, pager.class); data.map = datatlist;//assign here startactivity(i);
after redirect other page
data = data.map;// here
Comments
Post a Comment