How to Build AppCompatDialog From AlertDialog.Builder or Equivalent?

前端 未结 4 1561
无人及你
无人及你 2021-02-13 17:21

Before this I used a DialogBuilder to create AlertDialog like this

AlertDialog.Builder builder = new AlertDialog.Builder(context);
...
         


        
4条回答
  •  無奈伤痛
    2021-02-13 17:47

    Just found the solution. I should import

    import android.support.v7.app.AlertDialog;
    

    and then AppCompatDialog dialog = builder.create() will work.

提交回复
热议问题