Android Api 23 Change Navigation View headerLayout textview
Orium answer works and this will work as well.
View header = navigationView.inflateHeaderView(R.layout.nav_header_main);
TextView text = (TextView) header.findViewById(R.id.textView);
texto.setText("HELLO");
I had the same issue and was able to avoid it with this code:
View header = LayoutInflater.from(this).inflate(R.layout.nav_header_main, null);
navigationView.addHeaderView(header);
TextView text = (TextView) header.findViewById(R.id.textView);
text.setText("HELLO");
Now with the 23.1.1 release of the design support library, you can use
View header = navigationView.getHeaderView(0)
TextView text = (TextView) header.findViewById(R.id.textView);