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

简介: 版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/chaoyu168/article/details/51455746 报错如下:java.
版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/chaoyu168/article/details/51455746
报错如下:
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,然后导包,把下面报错的地方删掉运行就不报错了。
相关文章
|
7月前
解决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
101 4
android上FragmentTabHost实现自定义Tab Indicator
android上FragmentTabHost实现自定义Tab Indicator
53 1
Android 使用ViewPager和自定义PagerAdapter实现轮播图效果
Android 使用ViewPager和自定义PagerAdapter实现轮播图效果
155 0
细说 AppCompat 主题引发的坑:You need to use a Theme.AppCompat theme with this activity!
细说 AppCompat 主题引发的坑:You need to use a Theme.AppCompat theme with this activity!
细说 AppCompat 主题引发的坑:You need to use a Theme.AppCompat theme 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
275 0
【错误记录】Android 应用运行报错 ( 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. )
618 0
【错误记录】Android 应用运行报错 ( You need to use a Theme.AppCompat theme (or descendant) with this activity. )
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
Android ViewPager和PagerAdapter简单代码写法
Android ViewPager和PagerAdapter简单代码写法 总是忘记,记下来备忘: package zhangphil.
1542 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等