Back to project page myToDo.
The source code is released under:
Apache License
If you think the Android project myToDo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.gutspot.apps.android.mytodo.utils; /*from w w w.j a va 2 s.c o m*/ import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.os.Build; public final class AlertUtil { public static void show(Context context, String message, String yesLabel, DialogInterface.OnClickListener yesListener, String noLabel, DialogInterface.OnClickListener noListener) { AlertDialog dialog = new AlertDialog.Builder(context).create(); dialog.setTitle("????"); dialog.setMessage(message); dialog.setIcon(android.R.drawable.ic_dialog_alert); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { dialog.setButton(DialogInterface.BUTTON_POSITIVE, yesLabel, yesListener); dialog.setButton(DialogInterface.BUTTON_NEGATIVE, noLabel, noListener); } else { dialog.setButton(DialogInterface.BUTTON_POSITIVE, noLabel, noListener); dialog.setButton(DialogInterface.BUTTON_NEGATIVE, yesLabel, yesListener); } dialog.show(); } }