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

Posted hoge66的专栏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法相关的知识,希望对你有一定的参考价值。

 

报错如下:
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,然后导包

以上是关于You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法的主要内容,如果未能解决你的问题,请参考以下文章

Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context

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

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

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

Android You need to use a Theme.AppCompat theme (or descendant) with this activity.