android - How to pass an arrylist of LatLng from one activity to another -
i want pass arraylist
of latlng
variables 1 activity
through button click.
the 1 available string
not working please me out....
pass arraylist of parcelable objects.
// put coordinates arraylist<latlng> coordinates = new arraylist<>(); bundle bundle = new bundle(); bundle.putparcelablearraylist("coordinates", coordinates); // coordinates coordinates = bundle.getparcelablearraylist("coordinates");
to pass bundle need intent object use invoke other activity:
intent intent = new intent(firstactivity.this, secondactivity.class); intent.putextras(bundle); startactivity(intent);
then in secondactivity's oncreate fetch bundle:
arraylist<latlng> coordinates = getintent().getparcelablearraylistextra("coordinates");
Comments
Post a Comment