If an application needs to ask the user for a string, e.g a user name or a password, it can do so by using a simple dialog box that is customizable to some extent. here) On Android a standard Android dialog will be opened, again prompting the user for input. TextInputListener interface:

    1. public class MyTextInputListener implements TextInputListener { @Override public void input (String text) { } @Override public void canceled () { }}

    input() method will be called when the user enters a text string. The canceled() method will be called if the user closed the dialog on the desktop or pressed the back button on Android. To bring up the dialog, simple invoke the following method with your listener:

    1. MyTextInputListener listener = new MyTextInputListener();Gdx.input.getTextInput(listener, "Dialog Title", "Initial Textfield Value", "Hint Value");

    ApplicationListener.render() method is called. Prev | Next