Getting unknown exclamatory error in xml file Image view, when i try to set a ripple effect in "android:background" attribute.
I commented the line where i get this error.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="15dp"
>
<ImageView
android:id="@+id/tabImage"
android:layout_width="match_parent"
android:background="@drawable/tab_bg" <!-- Line where I get error-->
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:id="@+id/tabText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom|center" />
</LinearLayout>
If I click that exclamatory it directs to the following file.
v22/tab_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item android:id="@+id/mask"
android:drawable="@android:color/white"/>
</ripple>
The application is running perfectly, but i am not able to get this ripple effect.
Note: I am using Android Studio 1.4
Some programming and scripting languages also use exclamation points to indicate warnings and errors, as well as a method to identify a non-executable line of the code/statement. In UNIX scripting, the exclamation point is used for telling the operating system which application to use for running the script.
In Javascript, the exclamation mark (“!”) symbol, called a “bang,” is the logical “not” operator. Placed in front of a boolean value it will reverse the value, returning the opposite. ! true; // Returns false.
So the third use (!! x) turns the "falsey" value into a true boolean. ... with that in mind, the third exclamation point makes a TRUE negation of the original value (a negation of the "true boolean" value).
Don't worry, it's for the new Android Studio 1.4, it's appear because there, normally, appear a little icon showing the image from Drawable but if you are using a drawable xml (not being an image), the IDE cannot show a little preview but, don't worry for that error because It's not an error
=)
If you can't get the ripple effect maybe it's for another issue then you need to do another question for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With