Friday, June 29, 2012

[android-developers] Method for passing information between Fragments

I currently have two fragments setup on the same landscape screen.  On the left is a Map Fragment, while on the right is a List Fragment.  There is a MainActivity that creates the Fragments.  Each Fragment has its own Fragment class and Activity Class.  I am looking at the best method to allow the ArrayList of GeoPoints created from my ItemizedOverlay to populate the ListFragment by passing the list to the ListFragment when points are created.  Then, when a person clicks one of the points in the ListFragment, it sends back a message to the MapFragment that pops up an information bubble for the waypoint in question.

Basically, I am looking for the best method to pass this waypoint list (and a return point chosen) message between MapFragment and ListFragment.  If it would be better to have a third fragment that sits in the background to hold this information, I would be fine with that since in the future these points will be sent off to another phone.

I am sorry if this question has already been asked, but I have not been able to find a simple answer.  If you have a reference, I would be happy to look at that.  Thanks for the help.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment