Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@drawable vs @android:drawable in android

Is there any difference between

android:src="@andriod:drawable/filename"

and

android:src="@drawable/filename"

I can access the same resource in this way in xml file. What's the difference?

like image 441
Jeet Avatar asked Dec 06 '22 23:12

Jeet


2 Answers

There's a whole lot of difference:

android:src="@android:drawable/filename"

It allows you to only access those drawables which are provided by the android package, and:

android:src="@drawable/filename"

allows you to access those drawables that you put inside your app's drawable folder

like image 176
Sarthak Mittal Avatar answered Dec 10 '22 13:12

Sarthak Mittal


The difference between both calls is simple

android:src="@andriod:drawable/filename" 

This gives access to in-built drawable files in your android sdk.

and

android:src="@drawable/filename"

This gives access to in drawable files which are used for project ie, drawable in res folder of project folder in your android sdk.

While using the First one we can find out that it will not show the names of any drawable in res folder of project. And when you use second one it will not show names of in built drawable

You can find all in-built resources (drawable,animations etc) used by your API level in SDK

<your_path>\sdk\platforms\<api-level>\data\res

eg <your_path>\sdk\platforms\android-19\data\res this will show all in-built resource under API-19

like image 44
edwin Avatar answered Dec 10 '22 13:12

edwin