So I've been working on and Android app that has a Sherlock action Bar on the top and that part is working fine but now I want to be able to dynamically add Menu Items to the Sherlock Action Bar. I have to display log in name on screen if user is log in. Suppose on Activity A I have Log in Button. When that button is clicked then LoginActivity starts. After log in B activity is start. If user pressed back button from activity B then Activity A again starts. But menu items name is not displays. For that I am using onCreateOptionsMenu method.
Asked
Active
Viewed 45 times
0
-
in what activity you want to show logged user name? A, Login, B? You want to show name as a title? – agamov Mar 19 '14 at 13:14
-
In activity A. I am using getSupportMenuInflater().inflate(R.menu.home_menu, menu); in onCreateOptionsMenu method.\ – user2799407 Mar 19 '14 at 13:16