Reputation: 443
i added a up button in action bar sherlock by using below
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
but how can i get the text after the back button as shown in this below link.(In the below link how is Books getting added after up button)
http://developer.android.com/design/patterns/navigation.html
Upvotes: 1
Views: 244
Reputation: 8734
To get the title text use getSupportActionBar().getTitle();
To set the title use getSupportActionBar().setTitle(title);
OR getSupportActionBar().setTitle(resId);
To change the icon use getSupportActionBar().setIcon(resId);
Upvotes: 0
Reputation: 2738
You can set the title using getSupportActionBar().setTitle("something" or R.string.someId)
, you can set the tag line or subtitle with getSupportActionBar().setSubtitle("something" or R.string.someId)
. You have to make sure to also call getSupportActionBar().setDisplayShowTitleEnabled(true)
so it is actually displayed.
Upvotes: 1