Android Question GoogleMaps: Ignoring event: mapfragment1_ready

eurojam

Well-Known Member
Licensed User
Longtime User
For some unkown reasons sometimes I get the message in the logs "Ignoring event: mapfragment1_ready" (Release mode). In that case any action between the user and the google map leeds to an error: java.lang.RuntimeException: Object should first be initialized (GoogleMap).
The mapfragment is added with the designer as a custom type, the B4A Version is 6.00.
Any hints or help is very appreciated

best
stefan
 
No, the example works perfect without the ignore message - so I have to check my code again...thank you Erel
 
Upvote 0
No I didn't get that solved, as I mentioned, this happens sometimes, I guess that this something asynchronous between the map_ready event and the google response.

Best
Stefan
 
Upvote 0
Sorry, No, that was not it. The issue came up again.
But still once it worked.

The issue is coming up when you put gmap object in "Process_Globals" instead of "Globals".

I found the solution as adding another reference object as :

Code:
Sub Process_Globals
    Dim gmapglobal As GoogleMap
end sub

and updating it when i get gmap.

Code:
...
gmap = MapFragment2.GetMap
gmapglobal  = gmap
...

to use from other activities. I am not sure that i get the location correct then, but it works :

Code:
...
      vSurveyLat = Main.gmapglobal.MyLocation.Latitude
      vSurveyLon = Main.gmapglobal.MyLocation.Longitude
...
 
Upvote 0
I think i have found it this time.
I had a call :
Code:
If flgLogInShown= False Then
            CallLoginScreen
        flgLogInShown=True
    End If

which was actually closing the form and opening login activity (i think before map initialized completely).

You can check the "pause"s and "resume"s of your activities.

I changed it to :

Code:
If flgLogInShown= False Then
       CallSubDelayed(Me,"CallLoginScreen")
     flgLogInShown=True
   End If

Now it seems OK. If i find anything additional, i will let you know.
 
Upvote 0

Similar Threads

Replies
5
Views
3K
  • Locked
  • Article Article
Android Tutorial Google Maps
Replies
192
Views
205K
Back
Top