Change text dynamically for Android Actionbar Button -


I have an action bar (using actionbarslocks) in which it has two items, among which one user collected in my app The number of points is the number. I want to change this action bar button when the quantity change changes.

I do not know how to set the text of that button. What can I do to set this code through?

First you do not set "TextView One Button", because the button increases textview, The text itself is set up, you can try it in the following way at onCreate () :

  // of your activity. I think you create custom actionbase of this last choice: addView = getActivity (see) .getLayoutInflater (). Flow (R. layout.my_action_bar, tap); Bar.setCustomView (addView); Button = (button) addView.findViewById (R.id.button); Button.setText ("whatever");   

If you use the menu item, then you should try this approach:

  getSupportMenuInflater (). Flood (R. menu activation menu, menu); Menu item item = menu.findItem (R.id.menuSearch);   

Also try this, and It should be helpful.

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -