android.content.res.Resources$NotFoundException 异常处理

来源:互联网 发布:软件在线升级 编辑:程序博客网 时间:2024/05/29 02:42

如果需要配置android:theme 属性:

 

如:

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

 

xml文件:styles.xml:

 

<?xml version="1.0" encoding="UTF-8"?>

<resources>

<style name="notitle">

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

</style>

</resources>

 

以上会报Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable  异常

 

处理方法:

 

<?xml version="1.0" encoding="UTF-8"?>

<resources>

<style name="notitle" parent="android:Theme">

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

</style>

</resources>

原创粉丝点击