Missing buttons on AlertDialog | Android 7.0 (Nexus 5x)

前端 未结 9 1802
别那么骄傲
别那么骄傲 2020-12-05 13:19

I am trying to create an AlertDialog but the buttons are not showing. Only seeing this issue in Android 7.0:

final AlertDialog.Builder builder =         


        
9条回答
  •  执念已碎
    2020-12-05 13:50

    I had a similar issue and the thing was that I wasn't using the support library for my AppCompatActivity, therefore I changed:

    import android.app.AlertDialog;
    

    to

    import android.support.v7.app.AlertDialog;
    

    and it worked.

提交回复
热议问题