How to Build AppCompatDialog From AlertDialog.Builder or Equivalent?
问题 Before this I used a DialogBuilder to create AlertDialog like this AlertDialog.Builder builder = new AlertDialog.Builder(context); ... ... AlertDialog dialog = builder.create(); How can I build the new AppCompatDialog from a dialog builder, or is there another new equivalent way to do that? 回答1: Just found the solution. I should import import android.support.v7.app.AlertDialog; and then AppCompatDialog dialog = builder.create() will work. 回答2: If you would like to use an AlertDialog , just