DEV Community

Michel Zúñiga
Michel Zúñiga

Posted on

Answer: How to change text of a TextView in navigation drawer header?

Use getHeaderView`on your navigationView

NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
View headerView = navigationView.getHeaderView(0);
TextView navUsername = (TextView) headerView.findViewById(R.id.navUsername);
navUsername.setText("Your Text Here");

Top comments (0)