diff --git a/autojs/src/main/assets/modules/__dialogs__.js b/autojs/src/main/assets/modules/__dialogs__.js index fa84a3d0..8ac68ce6 100644 --- a/autojs/src/main/assets/modules/__dialogs__.js +++ b/autojs/src/main/assets/modules/__dialogs__.js @@ -69,7 +69,7 @@ module.exports = function(__runtime__, scope){ } return rtDialogs().select(title, items, callback ? callback : null); } - return rtDialogs().select(title, [].slice.call(arguments, 1)); + return rtDialogs().select(title, [].slice.call(arguments, 1), null); } dialogs.singleChoice = function(title, items, index, callback){ diff --git a/autojs/src/main/java/com/stardust/autojs/runtime/api/Dialogs.java b/autojs/src/main/java/com/stardust/autojs/runtime/api/Dialogs.java index cfe428c9..dc48284e 100644 --- a/autojs/src/main/java/com/stardust/autojs/runtime/api/Dialogs.java +++ b/autojs/src/main/java/com/stardust/autojs/runtime/api/Dialogs.java @@ -77,9 +77,7 @@ public class Dialogs { } @ScriptInterface - public Object select(String title, Object... args) { - Object callback = getCallback(args); - String[] items = getItems(args); + public Object select(String title, String[] items, Object callback) { return ((BlockedMaterialDialog.Builder) dialogBuilder(callback) .itemsCallback() .title(title) @@ -152,8 +150,8 @@ public class Dialogs { } @ScriptInterface - public int select(String title, Object... args) { - return (Integer) Dialogs.this.select(title, args); + public int select(String title, String[] items, Object callback) { + return (Integer) Dialogs.this.select(title, items, callback); } @ScriptInterface