错误描述:java.lang.IllegalStateException: You need to use a theme.appcompat theme (or descendant) with this activity

产生原因:Activity继承自AppCompatActivity,在style.xml中使用了不兼容的Theme。

从错误提示中提到Theme.AppCompat theme,这是因为我们的activity一定是继承了兼容包中的类,
比如我这里就无意中继承了AppCompatActivity,它来自android.support.v7.app.AppCompatActivity。
所以就要使用与其配合的AppCompat的theme才行。

解决:1、使用AppCompat theme;

   2、直接继承自Activity。

java.lang.IllegalStateException: You need to use a theme.appcompat theme (or descendant) with this activity的更多相关文章

  1. myeclipse 无法启动 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).

    把myeclipse10 按照目录完整拷贝到了另外一台电脑, 另外的目录 原安装目录 D\:\soft\i\myeclipse10 新安装目录 E\:\soft\myeclipse10 双击启动失败, ...

  2. java.lang.IllegalStateException:Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx...}: java.lang.IllegalSta ...

  3. java.lang.IllegalStateException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead

    java.lang.IllegalStateException: Not allowed to create transaction on sharedEntityManager - use Spri ...

  4. java.lang.IllegalStateException: getOutputStream() has already been called for this response

    ERROR [Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exceptionjava.lang ...

  5. 用java实现文件下载,提示java.lang.IllegalStateException: getOutputStream() has already been called for this response

    1. 用java实现文件下载,提示java.lang.IllegalStateException: getOutputStream() has already been called for this ...

  6. eclipse启动报错java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' befo

    报错: java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invo ...

  7. java.lang.IllegalStateException: Couldn't read row 1, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data fr

    Android中操作Sqlite遇到的错误:java.lang.IllegalStateException: Couldn't read row 1, col 0 from CursorWindow. ...

  8. java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

    在ViewPager中,用Fragment显示页面时,报错: java.lang.IllegalStateException: The specified child already has a pa ...

  9. java.lang.IllegalStateException:Web app root system property already set to different value 错误原因及解决 Log4j

    Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台.文件.GUI组件.甚至是套接口 服务器.NT的事件记录器.UNIX Syslog守护进程等: ...

  10. 关于viewpager 里嵌套 listview 同时实现翻页功能的“java.lang.IllegalStateException: The specified child..."异常处理

    这几天做项目用到了ViewPager,因为它可以实现左右划动多个页面的效果,然后 再每个页面里使用ListView,运行时总是出现”PagerAdapter java.lang.IllegalStat ...

随机推荐

  1. 图文教您轻松学会用PS设计制作名片

    图文教您轻松学会用PS设计制作名片 http://jingyan.baidu.com/article/49711c614e7370fa441b7ca3.html

  2. CentOS 安装nagios

    Nagios的介绍: 1.Nagios是一个监控系统运行状态和网络信息的监控系统.它能监控所指定的本地或远程主机的系统状态以及运行的服务,同时提供异常通知的功能. 2. Nagios可运行在Linux ...

  3. MongoDB(索引及C#如何操作MongoDB)(转载)

    MongoDB(索引及C如何操作MongoDB) 索引总概况 db.test.ensureIndex({"username":1})//创建索引 db.test.ensureInd ...

  4. [洛谷2397]yyy loves Maths VI

    题目背景 自动上次redbag用加法好好的刁难过了yyy同学以后,yyy十分愤怒.他还击给了redbag一题,但是这题他惊讶的发现自己居然也不会,所以只好找你 题目描述 他让redbag找众数他还特意 ...

  5. 【原创】一个复制本地文件到Hadoop文件系统的实例

    import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net ...

  6. HW5.9

    public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\t%s\ ...

  7. 【原】用PHP搭建基于swoole扩展的socket服务(附PHP扩展的安装步骤及Linux/shell在线手册)

    最近公司的一项目中,需要用PHP搭建一个socket服务. 本来PHP是不适合做服务的,因为和第三方合作,需要采用高效而稳定的TCP协议进行数据通信.经过多次尝试,最终选择了开源的PHP扩展:swoo ...

  8. Symfony VarDumper Component

    Symfony VarDumper 类似 php var_dump() 官方文档写的安装方法 : 按照步骤 就可以在 running any PHP code  时候使用了 In order to h ...

  9. cookie的存值和取值方式

    最近在开发中存储用户名信息,为了方便就使用了sessionStorage,但是写好才想到sessionStorage在IE下面是不支持的,所以无奈还是使用了cookie 那么接下来就谈谈怎么使用coo ...

  10. sdk 命令行

    1.关闭服务命令:adb kill-server 2. 启动服务命令:adb start-server 3.查询当前设备命令:adb devices 4.安装应用程序命令:adb install [a ...