heremaps / here-android-sdk-examples

Java-based projects using the HERE SDK for Android.
Apache License 2.0
145 stars 191 forks source link

MapView not redrawing when fragment gets replaced #191

Closed TostF closed 5 years ago

TostF commented 5 years ago

I've MapView in FragmentWithMap that is a part of ViewPager. When I replace FragmentWithViewPager that holds ViewPager with some other FragmentReplacer and return via PopBackstack my map does not get redrawn. Why is this happening?

I am triggering mapView.onPause() and mapView.onResume() in fragment lifecycle methods but it does not help. I've read that I should check if MapEngine is initialised and trigger onResume() only then but it did not help either.

What am I doing wrong?

I was looking for example of MapView being used in samples repository but all all of them includes MapFragment (which I would rather not use).

TostF commented 5 years ago

I would be great if you could provide a sample code of MapView implementation so I can check if I'm properly managing MapEngine.

NazarKacharaba commented 5 years ago

This issue is fixed in 3.10 release which will be out soon, probably next week.

TostF commented 5 years ago

Is MapView example possible tough? I have major performance issues when adding another map instance on view stack.

starand commented 5 years ago

@TostF, please see this sample app https://github.com/heremaps/here-android-sdk-examples/tree/master/route-tta

TostF commented 5 years ago

I'm going to close the issue for now. Will re-open if new version isn't going to fix the issue.