I hate to leave questions, but, I can't figure out how to fix this. Thanks in advance for help.
I have several actionbar tabs (4 of them), and on one of them I have a panel that I created using the designer. I want to show a googlemap on.
I'm using B4A vers. 5.50, Googlemaps library version 1.01, I checked my resource directory and it appears fine, and I also checked my manifest page. Everything seems right to me.
Here's the code:
All of this code runs, but right after it does it gets the error "Unfortunately, program has stopped"
It never runs this part:
If I comment out this line, the program runs (except no map and of course Maps_Ready won't run)
Here's the log:
Thanks in advance, any help is greatly appreciated.
-Dale
I have several actionbar tabs (4 of them), and on one of them I have a panel that I created using the designer. I want to show a googlemap on.
I'm using B4A vers. 5.50, Googlemaps library version 1.01, I checked my resource directory and it appears fine, and I also checked my manifest page. Everything seems right to me.
Here's the code:
B4X:
Sub Globals
...
' Map
Dim Gmap As GoogleMap
Dim MFrag As MapFragment
Dim MapPanel As Panel
...
End Sub
Sub Activity_Create(FirstTime As Boolean)
...
vp.Panels(2).LoadLayout("Det_Map")
' Map Stuff
Log("Loading Det_Map")
If MFrag.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Google Play services not available.", True)
Else
MFrag.Initialize("Maps", MapPanel)
End If
'
vp.Panels(3).LoadLayout("Det_Officers")
SVOfficers.panel.loadlayout("OfcDetPanel")
SVOfficers.Panel.Height = OfcPnlDetail.Height
bar.SelectedIndex = currentPage
strLocal = Main.CurrentLocal
Load_Data(strLocal)
End Sub
All of this code runs, but right after it does it gets the error "Unfortunately, program has stopped"
It never runs this part:
B4X:
Sub Maps_Ready
Log("map ready")
Try
Gmap = MFrag.GetMap
Catch
ToastMessageShow("Error initializing map.", True)
End Try
If Gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
Gmap.AddMarker(36, 15, "Hello!!!")
Dim cp As CameraPosition
cp.Initialize(36, 15, Gmap.CameraPosition.Zoom)
Gmap.AnimateCamera(cp)
End If
End Sub
If I comment out this line, the program runs (except no map and of course Maps_Ready won't run)
B4X:
' MFrag.Initialize("Maps", MapPanel)
Here's the log:
B4X:
...
Version D/L Complete: true
** Activity (main) Pause, UserClosed = false **
** Activity (detail_info) Create, isFirst = true **
Loading Det_Map
** Activity (detail_info) Resume **
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x42
at android.content.res.Resources.getResourceName(Resources.java:2713)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:882)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.BackStackRecord.run(BackStackRecord.java:684)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1453)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
Thanks in advance, any help is greatly appreciated.
-Dale
Last edited: