You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Add alert window on Android
This commit is contained in:
@@ -295,6 +295,25 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void alert(final String message, final String title) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getInstance());
|
||||
builder.setMessage(message).setTitle(title);
|
||||
builder.setPositiveButton(
|
||||
"OK",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static Godot _self;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user