Android Drawer Navigation Menu Item Click Not Working
Menu Item click not working I tried various things but it won't work. Here are my code: Home Activity: public class HomeActivity extends AppCompatActivity implements NavigationView
Solution 1:
Update These lines of code works for me.. after update clean and rebuild Project.
NavigationViewnavigationView= (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
navigationView.bringToFront();
Solution 2:
Here is a simple solution to address this issue. You can just link your HomeActivity methods to the menu items (whichever you want to). Now just create your methods and go to the menu layout. In the menu layout just add the android:onClick inside the item tag and put the particular method name inside it. And you are done. Let me know if this was useful.
Post a Comment for "Android Drawer Navigation Menu Item Click Not Working"