dialog Builder
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
class DialogUtils {
public static void dialogBuilder(Activity instance, String title,
String message, final DialogCallBack callBack) {
AlertDialog.Builder builder = new Builder(instance);
builder.setMessage(message);
builder.setTitle(title);
builder.setPositiveButton("Positive",
new android.content.DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
callBack.callBack();
}
});
builder.setNegativeButton("Negative",
new android.content.DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
}
}
interface DialogCallBack {
public void callBack();
}
Related examples in the same category