If I am reading this thread correctly, you want to handle the back button on Android devices?
If so, I would check out this StackOverflow post: http://stackoverflow.com/a/7241246
EDIT: You could also check if the device is android, and if so do the Android specific stuff yourself. I don’t have much experience with libgdx or android, though.
public void getTextInput (final TextInputListener listener, final String title, final String text, final String hint) {
handle.post(new Runnable() {
public void run () {
AlertDialog.Builder alert = new AlertDialog.Builder(context);
alert.setTitle(title);
final EditText input = new EditText(context);
input.setHint(hint);
input.setText(text);
input.setSingleLine();
alert.setView(input);
alert.setPositiveButton(context.getString(android.R.string.ok), new DialogInterface.OnClickListener() {
public void onClick (DialogInterface dialog, int whichButton) {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run () {
listener.input(input.getText().toString());
}
});
}
});
alert.setNegativeButton(context.getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick (DialogInterface dialog, int whichButton) {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run () {
listener.canceled();
}
});
}
});
alert.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel (DialogInterface arg0) {
// Handle this differently. called when back button hit.
}
});
alert.show();
}
});
}