summaryrefslogtreecommitdiff
path: root/platform/android/java/src
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2016-11-28 10:20:57 +0900
committervolzhs <volzhs@gmail.com>2016-11-28 10:20:57 +0900
commit9a20068ab7108357c78e9ac00eb90a3d72da7651 (patch)
tree4e5b22614c60b89d9bd797695315f072dfbc1d58 /platform/android/java/src
parentcefb2de339b3da78bacb80241280987e2a1e2df8 (diff)
Add alert window on Android
Diffstat (limited to 'platform/android/java/src')
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index 4b80db7e33..27b90cc669 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -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;