Before this I used a DialogBuilder
to create AlertDialog
like this
AlertDialog.Builder builder = new AlertDialog.Builder(context);
...
If you would like to use an AlertDialog
, just import the new supprt v 22.1
and use a code like this (pay attention to the import):
import android.support.v7.app.AlertDialog
AlertDialog.Builder builder =
new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
builder.setTitle("Dialog");
builder.setMessage("Lorem ipsum dolor ....");
builder.setPositiveButton("OK", null);
builder.setNegativeButton("Cancel", null);
builder.show();
If