I am building a brand new android project. It\'s not my 1st android app so I\'m much more frustrated not being able to get rid of this error...
I use an XML File, which
Because the drawable that's not showing up is itself inside a RelativeLayout, you need to put some position attributes in the cadremenu layout so that Android knows where to place it. For example, try:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="monteil.gaming.hundredious.MainActivity" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/fondipad"
android:contentDescription="@string/FondDesc"
/>
<RelativeLayout
android:layout_height="300dp"
android:layout_width="fill_parent"
**android:layout_alignParentTop="true"**
android:background="@drawable/cadremenu">
</RelativeLayout>
</RelativeLayout>
As @laato suggested, I checked my drawable/cadremenu file. I copied/pasted/overwrited the file in my project and then everything worked fine ! I actually had the same problem with all my other resources, like if my resources folder had been corrupted or something like that.
Thank you guys Hoping that someone will find help here someday
This exception usually occurs due to corrupt drawables. Make sure you are able to open and view all the drawable you have linked.
If you happen to see any error message of this sort or are unable to view your drawable then try replacing it again with the original file or if you have downloaded it then try re-downloading it.