尝试在Roboeltric中启动片段时出现NullPointerException -
java.lang.NullPointerException
at com.google.android.gms.common.internal.zzh.zzaT(Unknown Source)
at com.google.android.gms.common.internal.zzh.zzaT(Unknown Source)
at com.google.android.gms.common.internal.zzh.zzi(Unknown Source)
at com.google.android.gms.common.internal.zzh.zzi(Unknown Source)
该片段包含一个SupportMapFragment,这里是XML:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/recyclerVenue"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/map" />
SupportMapFragment
也在一个片段(android.support.v4.app.Fragment)中
@Before
public void setUp() {
mapFragment = new MapFragment();
startFragment(mapFragment); // Crashes here
}
将FrameLayout
更改为fragment
会导致sorry not implemented
消息。有人能指出我正确的方向,因为它在设备/模拟器上运行时有效吗?感谢