I am trying to change my screen once the button is pressed, which is working pretty well on my PC, there is no delay, and once the button is pressed, the scene instantly changes and presents the new one, however, when i tried to work my app on my android devices (LG G2X & Galxy S 3) I faced the following issue;
After pressing the button, there is a slight delay of about 1-2 seconds and only then it changes to my called screen.
I am disposing all of the resources in the dispose method, and I am also calling the dispose method from my hide
function since i don't want to hold extra screens in the background and waste memory.
here is my button:
private TextButton bPlay;
@Override
public void show() {
....
bPlay = new TextButton("PLAY", skin);
bPlay.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
((Game) Gdx.app.getApplicationListener())
.setScreen(new DifficultySelectorScreen());
}
});
bPlay.pad(15);
....
}
I add it to my table, and then to the stage, and once its clicked, it moves me to select the difficulty for the game.
now its not only this button that has a delay on it, but every button i try to use.