title: How to set the text on action bar programmatically
body: <p>I am working on android application in which i am using sherlock action bar. I want to change the text on my action bar programmatically when user clicked it. I have done it in Edit Text as:<code>editText.setText("Save");</code> when user clicked textView. I want to do it on run time when i clicked on action bar text it should be changed to "save" My code for action bar is given below:</p>
  
  <p><img src="https://i.stack.imgur.com/BHFnG.png" alt="enter image description here"></p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;item
          android:id="@+id/editTxt"
          android:showAsAction="always|collapseActionView"
          android:title="Edit"/&gt;
  
  &lt;/menu&gt;
  
  @Override
          public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
              MenuInflater inflater = getSupportMenuInflater();
              inflater.inflate(R.menu.main, menu);
              return true;
          }
  
  
          @Override
          public boolean onOptionsItemSelected(
                  com.actionbarsherlock.view.MenuItem item) {
              switch (item.getItemId()) {
  
              case R.id.editTxt:
                  return true;
  
              default:
                  finish();
              return super.onOptionsItemSelected(item);
          }
          }
  </code></pre>