In my application i created a login session.
I’ve got an ActionBar with two icon, “home” and “login”. I want to replace “login” with a string (Welcome Dude!, for example) after a successfull login.
I waked this way: if there’s no user logged, an action bar is shown, with HOME and ICON items. When a user is logged, another action bar is shown. In this second action bar i’d like to have HOME item and a welcome message.
Is that possible?
I thought also to create an item and set its text when the login is successfull, but i can’t do that.
Can anyone help me?
You can override
onPrepareOptionsMenu(). It works with ActionBarSherlock library:You just need to call
invalidateOptionsMenu();when the user logs in.Hope that helps.