You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法

艾米吖

关注

阅读 100

2022-11-24


在创建一个对话框风格的窗口时,报错

报错如下:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test2/com.example.test2.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

解决方法:

创建的activity是MainActivity extends ActionBarActivity这样的。把后面的ActionBarActivity改成Activity,然后导包,把下面报错的地方删掉运行就不报错了。。。


精彩评论(0)

0 0 举报