zoukankan      html  css  js  c++  java
  • java.lang.RuntimeException: Unable to start activity ComponentInfo……AppCompat does not support the current theme features

    Android测试时出现闪退的问题,出现了如下所示异常:

     java.lang.RuntimeException: Unable to start activity ComponentInfo{thonlon.example.cn.livetelecast/thonlon.example.cn.livetelecast.MainActivity}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features: { windowActionBar: false, windowActionBarOverlay: false, android:windowIsFloating: false, windowActionModeOverlay: false, windowNoTitle: false }

    启动不了应用的原因有很多,这里只是其中一例,这里的问题解决方式是:

    在style.xml:

    <resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>

    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <!--<item name="android:windowNoTitle">true</item>-->
    <!--<item name="windowActionBar">false</item>-->
    </style>

    </resources>

    中不要禁用默认主题的头部布局……(不要加入这样的代码)

    <item name="android:windowNoTitle">true</item>
    <item name="windowActionBar">false</item>

  • 相关阅读:
    Oracle面试题及答案整理
    Oracle问题总结
    Dubbo(四) -- telnet命令
    Dubbo(三) -- 多协议支持与多注册中心
    每天一算法 -- (冒泡排序)
    Dubbo(二) -- Simple Monitor
    数据库优化
    ActiveMQ内存配置和密码设置
    Dubbo源码导入Eclipse遇到的问题
    Dubbo(一) -- 初体验
  • 原文地址:https://www.cnblogs.com/qikeyishu/p/8974138.html
Copyright © 2011-2022 走看看