The problem:
I need to put a MapView in a ViewPager
More informations:
As the Mapview will be static (clickable="false") I won't have any issue with scrolling, or touch events. The ViewPager will get every touch and that's it.
What I have tried:
After a lot of Google search, I have found this awesome lib: https://github.com/inazaruk/map-fragment
My code in the Pager Adapter:
@Override
public Fragment getItem(int position) {
return new MyMapFragment(itineraries);
}
and my Constructor in the MyMapFragment:
public ArrayList<Itinerary> itineraries;
public MyMapFragment(ArrayList<Itinerary> itineraries) {
super();
this.itineraries = itineraries;
}
And that's working, I am really happy happy with the result and the behaviour when clicked is set to false
My Question:
As I want to draw the itineraries, I am completely stuck.
The MapFragment does not have any of the Mapview functions. I know I can edit the MyMapActivity class and make everything work there, but how is that possible to send the ArrayList from the Fragment to the Activity?
Currently the MapACtivity does not have any variable to draw the markers. All these informations are in the MapFragment