Reputation: 4376
I have an application with a user profile image in the action bar. See image below:
When the user opens the application I initially display a default user image: .
If they sign in I need to display their own image associated with their account: .
How I can change this image in the action bar?
Upvotes: 0
Views: 445
Reputation: 1967
maintain a status flag whether the user has logged in or not. in your onCreateOptionsMenu(), check this status to display the required icon for the actionbar menu. If you're doing the login in the same activity then u'll need to call invalidateOptionsMenu() method when the user has successfully logged in.
Upvotes: 1