In my project I have 2 activities in which both have an libGDX view, one in my main activity and the other one in a secondary activity which is not always in use (only if user wants), the problem I encounter is that when I come back from the secondary activity to the main activity the
does not work, it seems that the secondary activity is messing up something, if I change to any activity without an libGDX view and the come back to my main activity, this issue does not occur.
The request rendering is triggered by a button.
Some code from the main activity(my code is very large to paste it all here):
The code for the secondary activity is almost the same, I only changed the variables names (thought this was messing up something).
Is there a reason why this happen?
B4X:
lGdx.Graphics.RequestRendering
The request rendering is triggered by a button.
Some code from the main activity(my code is very large to paste it all here):
B4X:
Sub Activity_Resume
If lGdx.IsInitialized Then lGdx.Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If lGdx.IsInitialized Then lGdx.Pause
End Sub
B4X:
Sub LG_Create
ShRdr.Initialize
GD.Initialize("GD")
Camera.Initialize
Camera.SetToOrtho2(False,lGdx.Graphics.Width,lGdx.Graphics.Height)
Camera.Position.set(0, 0, 1)
If Not(CameraGroupStrategy.IsInitialized) Then CameraGroupStrategy.Initialize(Camera)
If Not(Batch.IsInitialized) Then Batch.Initialize(CameraGroupStrategy)
'Creates the five decals
Tex.Initialize("image1.png")
Tex.SetFilter(Tex.FILTER_Linear, Tex.FILTER_Linear)
TR.InitializeWithTexture(Tex)
Decal.Initialize2(0.6, 1.7, TR, True)
lGdx.Graphics.ContinuousRendering = False
End Sub
B4X:
Sub LG_Dispose
ShRdr.dispose
Batch.dispose
CameraGroupStrategy.dispose
If Tex.IsInitialized Then Tex.dispose
End Sub
The code for the secondary activity is almost the same, I only changed the variables names (thought this was messing up something).
Is there a reason why this happen?
Last edited: