Hey guys I am having reports from google with this error..
B4X:
Exception java.lang.IllegalArgumentException:
at android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1297)
at android.app.FragmentManagerImpl.addAddedFragments (FragmentManager.java:2431)
at android.app.FragmentManagerImpl.executeOpsTogether (FragmentManager.java:2210)
at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute (FragmentManager.java:2166)
at android.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:2067)
at android.app.FragmentManagerImpl$1.run (FragmentManager.java:742)
at android.os.Handler.handleCallback (Handler.java:958)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:230)
at android.os.Looper.loop (Looper.java:319)
at android.app.ActivityThread.main (ActivityThread.java:8919)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
I cannot replicate it.
So I asked chat GPT and he adviced to do B4xPages.ShowPage by CallDelayed so I tried to change all this callings to go through
B4X:
Sub SafeShowPage(PageID As String)
' Always delay the page switch to make sure the Activity and fragments are ready
CallSubDelayed2(Me, "InternalShowPage", PageID)
End Sub
Private Sub InternalShowPage(PageID As String)
If B4XPages.GetPage(PageID) <> Null Then
B4XPages.ShowPage(PageID)
Else
Log("Page " & PageID & " does not exist.")
End If
End Sub
But it seems it doesnt help..Same error popup from new version again..
Any advice ?
I have no idea what can cause this.
Yes, google map is in the project, its main part, localize you on map, draw route of your ride, show taxis on map etc..
I thought initialy that it has something to do with it but could find it..
And yes this is full error...nothing more
The reason that I asked about GoogleMaps is that it uses a Fragment to manage its state. This feature is rarely used in B4A.
I cannot say why this error happens here. We need more information. Check where you access the map from. Make sure that it only happens after the Ready event.