ActionBar items are from the options menu, rendered as buttons when shown on the bar. If you don't supply an icon, the title of the option MenuItem is used as the title of the button,
So, unless you are using a custom view, and you are simply using a menu item title as the score indicator, you can change that in onPrepareOptionsMenu()
. When you need to update, call invalidateOptionsMenu()
, and onPrepareOptionsMenu will be called for you.
eg
//user scores some points
mUserScore += points;
invalidateOptionsMenu();
then in the callback:
@Override
public void onPrepareOptionsMenu(Menu menu) {
MenuItem score = menu.findItem(R.id.score_menu_item);
score.setTitle(String.valueOf(mUserScore));
}