Activity使用主题不兼容报错-You need to use a Theme.AppCompat theme (or descendant) with this activity
今天在Activity界面弹出 一个AlertDialog时弹出以下错误:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
完整的log如下:
这是由于我的AlertDialog使用的android.support.v7.app.AlertDialog,
而Activity的主题使用的是
这2者使用的主题不兼容,所以导致上面的报错,把Activity的主题改为AppCompat的主题即可