Android Question [GMaps] MapFragment visible prop by code

Cableguy

Expert
Licensed User
Longtime User
Hi guys,

I am trying to use the GMaps lib, but starting it with the designer property "visible" set to false.... but then... how do I set that prop by code so that I can make it visible?
MapFragment does not expose such property (nor much else)
 

TILogistic

Expert
Licensed User
Longtime User
Use Javaobject.

test:

B4X:
Dim jo As JavaObject = gmap
Dim fragmentView As JavaObject = jo.RunMethod("getView", Null)
fragmentView.RunMethod("setVisibility", Array(0))  ' 0=VISIBLE, 8=INVISIBLE, 4=GONE
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I ended up using a simpler workaround, placing the mapfragment inside a panel, and controlling that panel's visibility.
But thanks anyway!
 
Upvote 0
Top