Reputation: 396
How is it possible to move from an android activity back to a libGdx screen . I am implementing a facebook API in my libGdx game. Whenever i press the facebook button in my game, it takes me to the android activity which logs me into facebook and displays some information using an Interface in the core project.
public void LoginFacebook() {
handler.post(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(context, LoginActivity.class);
context.startActivity(intent);
}
});
}
Now i'm wondering how to achieve the same thing but reversed.
How can i move from my results page (android) to my Mainmenu screen (libgdx core)?
Upvotes: 0
Views: 1502
Reputation: 20140
Any Screen of LibGDX is nothing more than a type of View of AndroidLauncher
activity.
When you open any other activity by using Interface then Activity that having LibGDX view is Paused and fold in background.
You can use Intent to move back to your Libgdx Activity from any activity.
Intent intent = new Intent(this, AndroidLauncher.class);
startActivity(intent);
Or possibly by finish()
you can go back to previous Activity.
Upvotes: 1