java - how to send intent in two different class at fragment -
i have variable sent through ntent, , sent 2 different classes, how? intent this:
case 0: position = new latlng (-8.447159, 112.651799); args.putparcelable ("place_position", position); = new intent (getactivity (), mapsmenu.class); a.putextra ("lat", args); a.putextra ("post", "cave"); a.putextra ("location", "south beach goa china in malang"); break;
key 'post' sent class a, while key 'location' , 'lat' sent class b, use fragment of actionsherlock, variable sent class b, while class not appear, following source code:
public class extends sherlocklistfragment { listview list; list<hashmap<string, string>> alist = new arraylist<hashmap<string, string>>(); imageview imdetail; string pos; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // todo auto-generated method stub intent in = getactivity().getintent(); pos = (string) in.getstringextra("post"); return super.oncreateview(inflater, container, savedinstancestate); }
and b class :
public class b extends sherlockmapfragment { string title; private googlemap map; latlng lat = null; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view root = super.oncreateview(inflater, container, savedinstancestate); map = getmap(); bundle bundle = getactivity().getintent().getparcelableextra("lat"); intent in = getactivity().getintent(); title = (string) in.getstringextra("location"); lat = bundle.getparcelable("place_position"); loadmaps(lat, title); return root; }
am missing something?
you put 2 items intent called "post" , "location". search "pos" , "lokasi". think that's why class cannot find intent-items.
Comments
Post a Comment