Standard Android menu icons, for example refresh
Never mind, I found it in the source: base.git/core/res/res and subdirectories.
As others said in the comments, if you have the Android SDK installed it’s also on your computer. The path is [SDK]/platforms/android-[VERSION]/data/res
.
How to select standard Android menu icons?
What's wrong with using drawables? Icons are drawables. If you use the R.android.drawable.*
drawables, you'll get the appropriate image based on your phone (Sense, stock Android 2.0, stock Android 2.3, etc).
how do i tell the android launcher to reload its icons?
go into "Settings -> Applications -> Manage Applications", on the nexus one at least, you have to go into the menu and "Filter" and then change to "All". the htc evo 4g defaulted to "All". Then select "Launcher" (at least if you're on stock android) and "click" the "Force stop" button. the launcher then automatically restarts when you go back to the home screen. functional brute force approach.
Where can I find Android's default icons?
\path-to-your-android-sdk-folder\platforms\android-xx\data\res
Why shouldn't I use the menu icons provided by the OS?
The problem is that you are adding in a dependency that google does not guarantee will be static.
The names of these icons could change, the size could change and become incompatible with your app.
If you want icons to be the same as the current google ones, you can use the ones available here
How to update a menu item shown in the ActionBar?
Option #1: Try invalidateOptionsMenu()
. I don't know if this will force an immediate redraw of the action bar or not.
Option #2: See if getActionView()
returns anything for the affected MenuItem
. It is possible that showAsAction
simply automatically creates action views for you. If so, you can presumably enable/disable that View
.
I can't seem to find a way to get the currently set Menu to manipulate it except for in onPrepareOptionMenu.
You can hang onto the Menu
object you were handed in onCreateOptionsMenu()
. Quoting the docs:
You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreateOptionsMenu() is called.
How to add buttons like refresh and search in ToolBar in Android?
OK, I got the icons because I wrote in menu.xml android:showAsAction="ifRoom"
instead of app:showAsAction="ifRoom"
since i am using v7 library.
However the title is coming at center of extended toolbar. How to make it appear at the top?
How to change option menu icon in the action bar?
The following lines should be updated in app -> main -> res -> values -> Styles.xml
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item>
</style>
<!-- Style to replace actionbar overflow icon. set item 'android:actionOverflowButtonStyle' in AppTheme -->
<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.Light.ActionButton.Overflow">
<item name="android:src">@drawable/ic_launcher</item>
<item name="android:background">?android:attr/actionBarItemBackground</item>
<item name="android:contentDescription">"Lala"</item>
</style>
This is how it can be done. If you want to change the overflow icon in action bar
Related Topics
Low-Latency Audio Playback on Android
Remove Image from Cache in Glide Library
How to Create a Relativelayout Programmatically with Two Buttons One on Top of the Other
Programmatically Obtain the Android API Level of a Device
How to Run an Android App in Background
How to Parse Same Name Tag in Android Xml Dom Parsing
Viewpager in a Nestedscrollview
How to Force an Entire Layout View Refresh
Android Vpnservice to Capture Packets Won't Capture Packets
How to Make Custom Dialog with Rounded Corners in Android
Trying to Get the Display Size of an Image in an Imageview
Navigation Drawer Below Toolbar
Adb Server Version (36) Doesn't Match This Client (39); Killing
Differencebetween Activity and Context
What File System Path Is Used by Android's Context.Openfileoutput()
Which Architecture Patterns Are Used on Android
How to Use Autocompletetextview and Populate It with Data from a Web API