我目前正在SupportMapFragment
使用 google-play-services 库 r3 实现我自己的子类。
NullPointerException
当我尝试将 Fragment 添加到Activity
or时,我得到了库的内部类之一ViewPager
。这是相关的堆栈跟踪:
java.lang.NullPointerException
at maps.y.p.onResume(Unknown Source)
at com.google.android.gms.maps.internal.IMapFragmentDelegate$Stub.onTransact(IMapFragmentDelegate.java:115)
at android.os.Binder.transact(Binder.java:310)
at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onResume(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$a.onResume(Unknown Source)
at com.google.android.gms.internal.c$1.a(Unknown Source)
at com.google.android.gms.internal.c.a(Unknown Source)
at com.google.android.gms.internal.c.onResume(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment.onResume(Unknown Source)
at android.support.v4.app.Fragment.performResume(Fragment.java:1503)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)
at android.support.v4.app.FragmentManagerImpl.performPendingDeferredStart(FragmentManager.java:807)
at android.support.v4.app.FragmentManagerImpl.startPendingDeferredFragments(FragmentManager.java:1112)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1461)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:461)
显然,此时内部地图为空。
有没有人已经遇到过这个问题并有解决方案?