I have (very rarely) a crash in Mapfragment_Ready event.
Can you guess why ?
Myme it should be intented that MySub.TileType is not initialized (and not GoogleMap) ?
Can you guess why ?
B4X:
Sub MapFragment1_Ready
Log("MapFragment1_Ready")
GoogleMap1=MapFragment1.GetMap
If GoogleMap1.IsInitialized = False Then
ToastMessageShow("Error initializing map", True)
Activity.Finish
End If
GoogleMap1.MapType= MySub.TileType <<----- this is the crash line
'ìì--------- beginning of crash
'java.lang.RuntimeException: Object should first be initialized (GoogleMap).
'at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
'at anywheresoftware.b4a.objects.MapFragmentWrapper$GoogleMapWrapper.setMapType(MapFragmentWrapper.java:297)
'at it.xxxxx.main._mapfragment1_ready(main.java:7605)
Myme it should be intented that MySub.TileType is not initialized (and not GoogleMap) ?