Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Android's built-in icons

I want to use Android's built in icons, I don't know how, I tried to use this two lines:

    android:background="@drawable/ic_lock_silent_mode_off"

    android:background="R.drawable.ic_lock_silent_mode_off"

Both lines aren't working for me, how can I use this icon to my button?

I get this error:

error: Error: No resource found that matches the given name (at 'background' with value '@drawable/ic_lock_silent_mode_off').
like image 296
user3821158 Avatar asked Jul 09 '14 22:07

user3821158


1 Answers

With that, you are trying to reference your own drawable, not Android's.

You need to use:

android:background="@android:drawable/ic_lock_silent_mode_off"
like image 197
matiash Avatar answered Sep 17 '22 18:09

matiash