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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -