AlertDialog: handle buttons

This commit is contained in:
Julian Winkler
2024-07-24 22:52:33 +02:00
committed by Mis012
parent fb82eabd2c
commit 7b11277287
3 changed files with 20 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ import android.view.View;
public class AlertDialog extends Dialog implements DialogInterface {
private native void nativeSetMessage(long ptr, String message);
private native void nativeSetButton(long ptr, int whichButton, String text);
private native void nativeSetButton(long ptr, int whichButton, String text, OnClickListener listener);
private native void nativeSetItems(long ptr, String[] items, DialogInterface.OnClickListener listener);
public AlertDialog(Context context) {
@@ -24,7 +24,7 @@ public class AlertDialog extends Dialog implements DialogInterface {
}
public void setButton(int whichButton, CharSequence text, OnClickListener listener) {
nativeSetButton(nativePtr, whichButton, String.valueOf(text));
nativeSetButton(nativePtr, whichButton, String.valueOf(text), listener);
}
public static class Builder {