2

I'm working on an android app with an advanced integration of Google Maps API V2. I'm using SupportFragment and everything worked fine until I started to put the map in an further child fragment - there is a deep fragment hierarchy:

SplitViewFragment->RightChildFragment->ViewPagerFragment->SupportMapFragment

I want to achieve a special layout for tablets, so it is not possible to remove one fragment level.

So far, so good - everything is working very well on Android 4.3+ Devices but on lower API levels, the map fragment always remains blank/transparent - the google logo and the zoom controls are visible. There is no logcat error. Google Map is working on the same device when I remove one nested fragment; so it's not an authentication problem, as often described.

I also tried to initialize the MapFragment with zOrderOnTop without success:

GoogleMapOptions options = new GoogleMapOptions(); options.zOrderOnTop(true); SupportMapFragment mapFragment = SupportMapFragment.newInstance(options);

I spent two complete days on trying to find an answer for this problem and did an extensive research - without success.

I'm so looking forward to your answers. Thanks a million!

goon
  • 589
  • 1
  • 6
  • 11

2 Answers2

0

I once faced this problem. Hope this link will help you :)

thanks to jcampbell05

If you've used the SupportMapFragment on older Android devices then you know how annoying it can be when it leaves a black box whenever you scroll a ListView, ScrollView or a ViewPager.

The reason behind this is that the Map uses a SurfaceView, when the App creates this view it creates a Window behind your Activity's and punches a hole meaning things in your Activity's window cannot seen underneath the SurfaceView's original location.

Community
  • 1
  • 1
milcaepsilon
  • 272
  • 3
  • 16
  • Thanks a lot for your quick response - i've already found this custom SuppportMapFragment implementation - unfortunately it does not solve the problem - the drawingView in this example is a TextureView on the problematic device - the code returns at line 146. It's so confusing - I feel so sad because the whole concept is not working then. – goon Sep 03 '15 at 11:58
0

Unbelievable - I have an animation view in hierarchy with hardware acceleration - I removed the acceleration for API Levels < 18 as there is a problem with clipPath:

setLayerType(View.LAYER_TYPE_SOFTWARE, null);

I fixed it by removing the deactivation of the hardware acceleration. I've to find another solution to be able to deactive the hardware acceleration.

Thanks a lot for your help.

goon
  • 589
  • 1
  • 6
  • 11