android - Action Bar No Resource Found. -
i trying run following code android studio guide:
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <!-- search, should appear action button --> <item android:id="@+id/action_search" android:icon="@drawable/ic_action_search" android:title="@string/action_search" android:showasaction="ifroom" /> <!-- settings, should in overflow --> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:showasaction="never" />
however, following code:
android:icon="@drawable/ic_action_search" android:title="@string/action_search"
it says:
cannot resolve symbol '@string/action_search' less... (ctrl+f1) validates resource references inside android xml files
and no resource matches given name.
i not sure how make of it. have googled extensively , these possible solutions?
- download image set @ "https://developer.android.com/design/downloads/index.html#action-bar-icon-pack". unable find download, , extract to.
i have tried:
- setting minsdk 11 (and 22) in gradle , in manifest
- redoing project , reading closely.
if shed light on situation grateful! have tried doing own research/ googling/ experimenting has come no avail.
you need create string value action_search reference.
<resources> <string name="app_name">my application</string> <string name="edit_message">enter message</string> <string name="button_send">send</string> <string name="action_settings">settings</string> <string name="action_search">search</string> <string name="title_activity_main">mainactivity</string> <string name="title_activity_display_message">my message</string> </resources>
to fix empty reference drawables have drop image name of reference ic_action_search.png in drawable folder.
Comments
Post a Comment