I am integrating ActionBarSherlock in my app and I want to have some menus with some items and its respective icons.
I have looked into samples and documentation, and everything seems to be clear, but when I Inflate the menu, I can see just the text because there are no icons related to each item yet.
I would like to use the icons you see when creating an android project:
But I can't find it, and I don't want to use direct reference to android.R.drawable in order to use those clipart icons, because I have read it is recommended to have the files in drawable folders.
In Android Studio inside the res folder, one can find the drawable folder, layout folder, mipmap folder, values folder, etc. Among them, the drawable folder contains the different types of images used for the development of the application.
drawable. image stores a resource id which will return an int. Save this answer.
A drawable resource is a general concept for a graphic that can be drawn to the screen and which you can retrieve with APIs such as getDrawable(int) or apply to another XML resource with attributes such as android:drawable and android:icon . There are several different types of drawables: Bitmap File.
In Android Studio, right-click on the “drawable” folder and select “New” » “Vector Asset”. From there, for “Asset Type”, select “Local file (SVG, PSD)” Enter a name for the icon. Enter the path to your icon, or use the folder icon to choose the icon in your file explorer.
android-sdk/platforms/android-xx/data/res/drawable-yyyy
where xx is your target platform and yyyy is mdpi, hdpi, etc.
Copy the icons you want into the appropriate resource folder in your project.
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