theapache64
theapache64

Reputation: 11754

Unknown Warning Icon - Android Studio

enter image description here

Here's my simple_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="false">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white" />
        </shape>
    </item>
    <item android:state_pressed="true">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/darker_gray" />
        </shape>
    </item>
</selector>

What is the reason behind the appearance of the Warning Icon, What am I doing wrong?

I am using Android Studio v1.4.1.

Upvotes: 3

Views: 756

Answers (2)

Tauseef
Tauseef

Reputation: 117

It's not an error from the code you wrote . It Means Android Studio failed to display thumbnail of the given drawable" visit Here for more:- unknown exclamatory symbol in the xml file

Upvotes: 3

tiny sunlight
tiny sunlight

Reputation: 6251

You should have a no-state item:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="false">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white" />
        </shape>
    </item>
    <item android:state_pressed="true">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/darker_gray" />
        </shape>
    </item>

    <item>
        <shape android:shape="rectangle">
            <solid android:color="@android:color/darker_gray" />
        </shape>
    </item>
</selector>

Upvotes: 1

Related Questions