Appolica / InteractiveInfoWindowAndroid

Library project, developed and maintained by Appolica, offering an interactive info window for Google maps on Android.
249 stars 56 forks source link

Getting an error when trying to add detail for multiple map markers #32

Closed thebeancounter closed 6 years ago

thebeancounter commented 6 years ago

Hi!

Great work, thanks for everything.

I am trying to create a custom popup detail for multiple markers on the map.

I am creating multiple map markers in a loop and adding the following code to add the detail:

MapInfoWindowFragment mapInfoWindowFragment = (MapInfoWindowFragment) getSupportFragmentManager().findFragmentById(R.id.infoWindowMap);

                    InfoWindow infoWindow = new InfoWindow(mark, new InfoWindow.MarkerSpecification(0,0), mapInfoWindowFragment);
                    // Shows the InfoWindow or hides it if it is already opened.
 mapInfoWindowFragment.infoWindowManager().toggle(infoWindow, true);

When getting to the toggle, I get the following error:

java.lang.IllegalStateException: Can't change container ID of fragment MapInfoWindowFragment{a5d2a5e #1 id=0x7f070049 InfoWindow}: was 2131165257 now 2131165256

I used the code in a loop so I removed the "final" from the code, does that mean i can't use it multiple times in the same map? should i create an array of infoWindows?

Thanks!

cwbsl commented 4 years ago

How did you resolve this issue? I'm facing the same one at the moment...