2020-08-13
程序员文章站
2022-03-20 08:30:13
AlertDialog You need to use a Theme.AppCompat theme (or descendant) with this activity.解决方案:将:super(context);修改为super(context,R.style.AppTheme);public class MyDialog extends AlertDialog { private Context context; private Bu......
AlertDialog You need to use a Theme.AppCompat theme (or descendant) with this activity.
解决方案:
将:super(context);修改为 super(context,R.style.AppTheme);
public class MyDialog extends AlertDialog { private Context context; private Button ivConfirm, ivCancel; private ImageView popCancel; private TextView tvMessage; public MyDialog(@NonNull Context context) { super(context,R.style.AppTheme); this.context = context; }
}
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style>
本文地址:https://blog.csdn.net/happyhell/article/details/107977986
上一篇: 中国5G 700M频谱情况。
推荐阅读