Search code examples
androidandroid-studioselectorandroid-drawable

How to make a selector in Android Studio


While taking a course, I was instructed to make an xml selector for a Button. The course said to make a new Android xml in Eclipse, but i am using Android Studio.

Also when I custom write the code it gives me an error. It says "element selector must be declared".

as you can see selector is an error

Got code from here: Android: How to Make A Drawable Selector.

Does anyone know how to do this in Android Studio?


Solution

  • Though it is already answered in the comment, enter image description here