I have just started writing my first ever Java/Android application, so forgive the total n00b question.
How do you access the the standard operating system icons such as search icon/menu icon etc? They are not in the res/drawable folder where I would expect to find them. Are they available as part of the SDK or must you download them seperately?
EDIT
Maybe you can help me further - I am getting the following error (repeated on):
[2011-09-08 19:59:47 - TweetTab] C:\Users\Dan\workspace\TweetTab\res\menu\options_menu.xml:4: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_search').
However, the icon is not empty, the xml looks like this:
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/search" android:icon="@drawable/ic_menu_search" android:title="@string/search"/> </menu>
Am I missing something?
SOLVED
I changed android:icon="@drawable/ic_menu_search"
to android:icon="@android:drawable/ic_menu_search"
and it could then find the icon.
Then after installing your app, the OS will pick the icon that matches your phone configuration and create a shortcut on your installed apps page. The icons reside inside the . apk of each individual app.
The res/values folder is used to store the values for the resources that are used in many Android projects to include features of color, styles, dimensions etc.
Resource Manager is a tool window for importing, creating, managing, and using resources in your app. You can open the tool window by selecting View > Tool Windows > Resource Manager from the menu bar or by selecting Resource Manager on the left side bar. Click Add to add a new resource to your project.
You can acces them via android.R.drawable.*
or in xml by @android:drawable/something
.
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