Skip to content Skip to sidebar Skip to footer

Nav Header Not Displaying Textvalues From Mainactivity In Kotlin

I have an applcation that utilizes the Navigation drawer and I am supposed to change the nav_header values based on the user's input but I am unable to do that as the values never

Solution 1:

Use this:

val navigationView = findViewById<NavigationView>(R.id.your_nav_view_id);
val header = navigationView?.getHeaderView(0)

val text = header?.findViewById<TextView>(R.id.textView); 
// initialize your widgets in here
// And simply use, "header" prefix before initializing your widgets..

Post a Comment for "Nav Header Not Displaying Textvalues From Mainactivity In Kotlin"