Is it possible to add a timer to the actionbar on android?
问题 I'd like a simple mm:ss timer to be displayed on my actionbar, be able to pick the number of minutes to start counting down from and then call a method once it's at 0. Is this possible and how? Thank you 回答1: I've managed to do that by adding a TextView to the Action Bar as an Action View in the menu, then updating it at regular intervals using a CountDownTimer . (Tested on an Android 3.0 emulator, an Android 4.3 emulator and a real device running Android 4.3). Here's the XML for the menu