I am using option selected menu item, attached three item (share, login, logout) am select login item, go login activity login social sign (Facebook or google) any one, if login hide login item at same time show logout item, this same type if logout the social sign show login item menu, please help me...
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
step:1) menu.xml define all three menu item. login ,logout and share after that make logout visibility to false by default
and make remaining two items visible.its optional because by default all items are visible in android
Step:2)when you are in login Activity inflate that xml.and no need to make any change in activity at these point we are showing login and share menu item only and we have already made logOff item visibility to false in the xml .
step:3) when you are in main activity(activity that you are showing after login activity) do these
at these point you will get logOff and share because we have made login menu item visibility to false .
In your
Activity
after successful login take handle of themenuItem
inActionBar
and change it's visibility stateIf you're using
Toolbar
then it will be likeSo
setVisible(boolean)
will change the visibility of amenuItem
. Hope this helps