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?
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
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
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