0

私の何が問題なのAlertDialogですか?「after builder set items」に到達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");
4

2 に答える 2

0

Plugin の代わりに CordovaPlugin を拡張するようにプラグインを変更したところ、問題は解決しました。

于 2013-02-26T20:47:35.193 に答える
-1

あなたは書かなければならない

builder.create().show();

それ以外の

builder.show();
于 2013-02-26T20:42:24.477 に答える