I am integrating Google and Facebook to my application, i.e. I have 2 ways to login in the login page. I have a navigation drawer in the main activity. In the drawer, I have a logout item. I want to be able to set the icon to Google icon or Facebook icon depending on the login method user choose.
For example, if the user logged in with Facebook, the icon of logout button will be a Facebook icon.
Is there a way to somehow set the icon in main activity class? Like
NavigationView navigationView = (NavigationView)findViewById(R.id.nav_view); navigationView.getMenu().getItem(1).setIcon(R.drawable.com_facebook_button_icon_white);
Hope this helps