Android设置无title报错

一直将代码:requestWindowFeature(Window.FEATURE_NO_TITLE)

放在代码:setContentView(R.layout.activity_main)之前执行,本以为完事大吉了,结果掉坑了。。。。

出bug情形:

MainActivity extends android.support.v7.app.ActionBarActivity

且清单文件中android:theme 继承自Theme.AppCompat.Light.DarkActionBar

这样即使requestWindowFeature(Window.FEATURE_NO_TITLE)放在setContentView(R.layout.activity_main)之前执行还是会报错requestFeature() must be called before adding content

在andriod4.0以上的版本中,已经不需要v7兼容包了,所以索性将其删除

时间: 2024-08-29 03:08:24

Android设置无title报错的相关文章

每日总结 - android设置背景颜色报错

每天坚持总结,总会发生质变! 今天给radiobutton设置背景颜色报错,信息如下: item> tag requires a 'drawable' attribute or child tag defining a drawable 解决方法: 你不能将颜色选择器用在background上,应该使用drawable selector. 1 <selector xmlns:android="http://schemas.android.com/apk/res/android&quo

Android 线程更新UI报错 : Can&#39;t create handler inside thread that has not called Looper.prepare()

MainActivity中有一个按钮,绑定了save方法 public void save(View view) { String title = titleText.getText().toString(); String timelength = lengthText.getText().toString(); ExecutorService exec = Executors.newCachedThreadPool(); exec.execute(new NewsService(getApp

android studio :com.android.support:appcompat-v7:21.+ 报错

android studio :com.android.support:appcompat-v7:21.+ 报错: 在project——>app——>build.gradle修改: apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "com.example.ri

android studio - 导入工程报错[Plugin with id &#39;com.android.application&#39; not found]

出错现象: 大概意思是找不到:com.android.application 插件,以上现象对于初学者来说会经常碰到,下面分析下产生的原因. 原因分析 首先来看看导入后的工程结构: 对于此工程结构,是否有个疑问? 这是未正常同步完成的结构,Gradle Scripts下面似乎少了个 build.gradle ,上图红框部分描述清楚了是 Module: GraphicsDemo ,表示该 build.gradle 是Module的,而不是Project的.来看看一个正常的 Project+Modu

Mac OSX Android 开发环境 模拟器报错

直接下载ADT mac版 模拟器报错处理 1. 显示隐藏文件命令 显示:defaults write com.apple.finder AppleShowAllFiles -bool true隐藏:defaults write com.apple.finder AppleShowAllFiles -bool false 2. 修改 /.android/avd/你的模拟器名字/emulator-user.ini window.x = 0 原因没有深究,可能和双屏有关? Mac OSX Androi

android studio创建模拟器报错解决 emulator: ERROR: This AVD&#39;s configuration is missing a kernel file!!

android studio创建模拟器报错 emulator: ERROR: This AVD's configuration is missing a kernel file!! 的解决办法 原因有二:1 没有,解决办法通过sdk mangager 下载 2 找不到,解决办法看系统环境变量path(此种情况多数发生在android Studio和EclipseADT同时存在的情况下) 原因是在刚刚安装完毕的androidstudio的sdk目录下没有system-image目录,也许有但没有相

Android Studio集成SVN报错:can&#39;t use subversion command line client : svn

Android Studio集成SVN插件,check out出代码后,每次开启都会在右上角出现如下错误: Can't use Subversion command line client: svn Probably the path to Subversion executable is wrong. Fix it. Errors found while svn working copies detection. Fix it. 下面直接上解决方案吧: 1.安装客户端http://ncu.dl

Android Studo 使用 JNI报错:java.lang.UnsatisfiedLinkError: Couldn&#39;t load XXX from loader dalvik.system.PathClassLoader

今天在使用Android Studio的时候突然发现代码没错,so包也引入了,各个版本都引入了,但是就是一直报错: java.lang.UnsatisfiedLinkError: Couldn't load serphone from loader dalvik.system.PathClassLoader 11-30 11:13:18.766 29255-29255/com.personal.tai.ronglianim E/AndroidRuntime: at java.lang.Runti

error_reporting() 设置 PHP 的报错级别并返回当前级别

error_reporting() 设置 PHP 的报错级别并返回当前级别. 语法 error_reporting(report_level) 如果参数 level 未指定,当前报错级别将被返回.下面几项是 level 可能的值: 1 E_ERROR 2 E_WARNING 4 E_PARSE 8 E_NOTICE 16 E_CORE_ERROR 32 E_CORE_WARNING 64 E_COMPILE_ERROR 128 E_COMPILE_WARNING 256 E_USER_ERROR