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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -