我的AlertDialog
有什么问题? Logcat
仅在构建器设置项“ 之后进入 ”,然后停止并且没有错误消息。其他应用程序继续没有问题。无法弄清楚为什么AlertDialog
不会显示。
AlertDialog.Builder builder = new AlertDialog.Builder(this.cordova.getActivity());
Log.d(LOG_TAG, "after new AlertDialog");
builder.setTitle(title);
Log.d(LOG_TAG, "after builder set title");
CharSequence[] choicesAsCharSeq = choices.toArray(new CharSequence[choices.size()]);
builder.setItems(choicesAsCharSeq, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// The 'which' argument contains the index position
// of the selected item
Log.d(LOG_TAG, "Index #" + which + " chosen.");
String result = "";
result = "" + which;
// ActionSheet.this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
Log.d(LOG_TAG, "after builder set items");
builder.show();
Log.d(LOG_TAG, "after builder show");
答案 0 :(得分:0)
builder.create().show();
而不是
builder.show();
答案 1 :(得分:0)
我更改了我的插件以扩展CordovaPlugin而不是插件,问题就消失了。