android.content.res.Resources$NotFoundException 異常處理

如果需要配置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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章