Subclassing SupportMapFragment results in a NullPointerException

I'm currently implementing my own subclass of SupportMapFragment, using the google-play-services library r3.

I get a NullPointerException in one of the internal classes of the library when I try to add my Fragment to an Activity or ViewPager. Here's the relevant stacktrace:

    at maps.y.p.onResume(Unknown Source)
    at android.os.Binder.transact(
    at$a$a.onResume(Unknown Source)
    at$a.onResume(Unknown Source)
    at$1.a(Unknown Source)
    at Source)
    at Source)
    at Source)

Apparently the internal map is null at this point.

Did anyone already run into this issue and has a solution?


In your subclass of SupportMapFragment, did you override onCreateView(...)?

If you did, you'd need to also call super.onCreateView(...) in your own onCreateView(...) to let the super class to create its view. The fragment is tied closely with the underlying view.

Try getChildFragmentManger() Also make sure you populate in or after onActivityCreated()

The Docs also seem to suggest that if the underlying Maps System is not running it will not work.

Also check you are using v11 of ACL (although I doubt thats the issue).

Need Your Help

Can ReSharper generate code that copies properties from one object to another?

c# visual-studio resharper

I'm looking for a way to accelerate a repeatable task when I write code. I have ReSharper and I'm thinking a customization could do what I need.

Android - How to stop animation between activity changes

android animation android-intent flags

I have multiple different Activity in my app and I don't want any transition animation when changing between Activities. Below is the how I'm changing between Activities: