- Home /
show Alertdialog in android
I have a simple plugin written in Java that displays an alert dialog, like this:
public class TestAlert {
public boolean dialogResult = false;
public void ShowTestDialog( Activity activity ) {
AlertDialog.Builder builder = new AlertDialog.Builder( activity );
builder.setMessage( "This is a test" )
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialogResult = true;
dialog.dismiss();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialogResult = false;
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
how to send activity from unity to plugin???
Comment
Delete those unnecessary gaps. It's hard to read your code this way.
Your answer
Follow this Question
Related Questions
android: why scene goes black when showing new activity? 3 Answers
Android - Non main activity plugin not working: Class Not Found Exception 1 Answer
UnityPlayer in an Android MapActivity 3 Answers
How can I replace correctly the main activity on the Android Manifest? 0 Answers
Android plugin & Activity help needed - "GetMethodID method not found" problems 0 Answers