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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

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

c# - Search and Add Comment with OpenXML for Word -