Android Question What can you make out of this error?

hatzisn

Expert
Licensed User
Longtime User
I get an error in my application which I cannot address at all. The error occurs in an SMS Interceptor messagereceived event when I return true. Before I return true I initialize a google map. Any help would be highly appreciated

Here are the logs:

** Activity (locate) Create, isFirst = true **
** Activity (locate) Resume **
Entered Locate.GotSMS_MessageReceived
Entered Locate.InitializeMap
Exiting Locate.InitializeMap
Exiting Locate.GotSMS_MessageReceived

android.content.res.Resources$NotFoundException: Unable to find resource ID #0x18
at android.content.res.Resources.getResourceName(Resources.java:2529)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:895)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1075)
at android.app.BackStackRecord.run(BackStackRecord.java:682)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1455)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:441)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5319)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
--------- beginning of /dev/log/system

Here is my code:
B4X:
Sub GotSMS_MessageReceived (From As String, Body As String) As Boolean
    Starter.sSub = "Locate.GotSMS_MessageReceived"
    Log ("Entered Locate.GotSMS_MessageReceived")
    .
    .
    .
    gblLat = 37.9789722
    gblLong = 23.7780057
    InitializeMap
    Log ("Exiting Locate.GotSMS_MessageReceived")
    Return True
End Sub

Sub InitializeMap
    Log ("Entered Locate.InitializeMap")
    Starter.sSub = "Locate.InitializeMap"
    If bMap = False Then
        ToastMessageShow("Google Play Services is not available.", True)
        Return
    End If
    pnlMap.Visible = True
    'pnlMapContainer.Visible = True
    webvLegal.Visible = False
    sMarkTitle = "GPS Lock"
    mFragment.Initialize("Map", pnlMap)
    Log ("Exiting Locate.InitializeMap")
End Sub

Sub Map_Ready
    Log ("Entered Locate.Map_Ready")
    Starter.sSub = "Locate.Map_Ready"

    Log("map ready")
    gmap = mFragment.GetMap
    gmap.MapType = gmap.MAP_TYPE_SATELLITE
    Dim sb As StringBuilder
    sb.Initialize
    sb.Append("<html>")
    sb.Append("<header>")
    sb.Append("</header>")
    sb.Append("<body>")
    sb.Append("<p>")
    sb.Append("<center>")
    sb.Append("<br />")
    sb.Append("<br />")
    sb.Append("<a href=""http://hideme.com"">Hide me...</a>")
    sb.Append("<br />")
    sb.Append("<br />")
    sb.Append("</center>")
    If bMap = True Then
        sb.Append(mFragment.GetOpenSourceLicenseInfo)
    Else
        ToastMessageShow("Google play services is not available.",True )
    End If
    sb.Append("</p>")

    sb.Append("</body>")
    sb.Append("</html>")
    webvLegal.LoadHtml(sb.ToString)
    If gmap.IsInitialized = False Then
       ToastMessageShow("Error initializing map.", True)
    Else
       SetMapPositionToMarker
       tbHost.CurrentTab = 3
       ProgressDialogHide
    End If
    Log ("Exiting Locate.Map_Ready")
End Sub
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User
Is there a tutorial for this? I would also like to ask if the pnlMap is located in a tab in TabHost could this be the problem?
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
The error was that it was inside the TabHost and when I moved the panel in the main activity everything worked fine...
 
Upvote 0
Top