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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -