You need to sign in to do that
Don't have an account?
Android User
How to remove menu option
From android native app login page using SalesforceSDK how can i hide/remove menu option.
I want to restict users they should not change server url.
I want to restict users they should not change server url.
Get a MenuItem pointing to such item, call setVisible on it to adjust its visibility and then call invalidateOptionsMenu() on your activity so the ActionBar menu is adjusted accordingly.
Update: A MenuItem is not a regular view that's part of your layout. Its something special, completely different. Your code returns null for item and that's causing the crash. What you need instead is to do:
For more visit this link,it will help you:
https://stackoverflow.com/questions/10692755/how-do-i-hide-a-menu-item-in-the-actionbar
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha