Android Question [SOLVED] No view found error on Google Maps

makis_best

Well-Known Member
Licensed User
Longtime User
I try to implement google maps example from here
but I get the error

java.lang.IllegalArgumentException: No view found for id 0x2711 (unknown) for fragment MapFragment{d857f87 #1 id=0x2711}
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:987)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.BackStackRecord.run(BackStackRecord.java:816)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:483)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6186)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

I search at forum but I didn't find anything.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
I mean I look in forum for the same error from another user but I didn't find anyone else had the same problem

In my project there is a tabhost with 3 tabs and in one layout of the three I have the MapFragment

But when I select the tab I get the above error

B4X:
Sub Globals
......
        Private gmap As GoogleMap
    Private MapFragment1 As MapFragment
End Sub

B4X:
Sub Activity_Create(FirstTime As Boolean)
..........
    TabHost1.AddTab("ΤΑΥΤΟΤΗΤΑ", "Client_info_TAFTOTHTA.bal")
    TabHost1.AddTab("ΕΜΠΟΡΙΚΟ", "Client_info_EMPORIKO.bal")
    TabHost1.AddTab("ΔΙΕΥΘΥΝΣΕΙΣ", "Client_info_DIEFTHYNSEIS.bal")
    ClientAddresses
End Sub

Inside Client_info_DIEFTHYNSEIS.bal I have the MapFragment view.

B4X:
Sub ClientAddresses
    Wait For MapFragment1_Ready
    gmap = MapFragment1.GetMap
    Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result Then
        gmap.MyLocationEnabled = True
    Else
        Log("No permission!")
    End If
End Sub
 
Last edited:
Upvote 0
Top