1

As you know this is LibGDX Lifecycle

           __________________________________
           |         ____       ____        |
           V         V   |      V  |        |
show --> resume --> resize <-- render --> pause --> hide --> dispose
           |          |          ^          ^
           |__________|__________|__________|

which is explained here : https://stackoverflow.com/a/21063460/5733853

I want to run my cods when I get back to previous screen:

MainmenuScreen.java --> GameScreen.java
         ^                     |
         |------------i am here|  

pause,resume,resize is clear that not work in this case and in render the codes run non stop and I got wrong answer so any help would be greatly thankful.

VahidHoseini
  • 495
  • 2
  • 10
  • 28

1 Answers1

1

If MainmenuScreen and GameScreen are extensions of the LibGDX Screen class, it has a method called show() that is called when that screen becomes the current screen.

https://libgdx.badlogicgames.com/ci/nightlies/docs/api/com/badlogic/gdx/Screen.html#show--

Tekkerue
  • 1,497
  • 1
  • 11
  • 17