在style.xml文件里定义

<?xml version="1.0" encoding="UTF-8" ?>  <resources>      <style name="notitle">          <item name="android:windowNoTitle">true</item>      </style>   </resources>  

然后在manifest.xml中引用就可以了

<application android:icon="@drawable/icon"           android:label="@string/app_name"           android:theme="@style/notitle">  

如果错误描述为

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

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

更多相关文章

  1. Android(安卓)编译环境配置搭建(Ubuntu 14)及环境导致编译错误
  2. A3```在android native c里打log
  3. [android]编译时出现/usr/bin/ld: skipping incompatible /usr/l
  4. Android使用代码
  5. Android调用 Webservice报org.ksoap2.serialization.SoapPrimiti
  6. Android(安卓)Studio Error:Connection timed out: connect.解决
  7. Android(安卓)TextView 支持的HTML标签
  8. android中的 Handler机制
  9. Android(安卓)OpenGL ES(五):GLSurfaceView

随机推荐

  1. Android 实用工具之HierarchyViewer
  2. android屏幕分辨率详解 ldpi mdpi hdpi
  3. 使用maven构建android 的apk包并自动签名
  4. Android自动化测试框架开发(二)Monkey、Mon
  5. Android(安卓)中 shape 图形的使用
  6. 删除Android工程中冗余资源
  7. Android(安卓)学习 之 API文档汇总(不断更
  8. android性能测试方法
  9. Android(安卓)- Unparsed aapt error(s)
  10. Android获取软键盘输入内容