I am trying to create Navigation view like gmail. In the header layout I have one image view and two textView. I have registered the click events for the TextView. But when I click the onClick methods the listener are not triggering (Code is in Kotlin)
navigation_view is the id of my NavigationView
var headerView = navigation_view.getHeaderView(0)
var accountName: TextView = headerView.findViewById(R.id.account_name)
accountName.setOnClickListener { Toast.makeText(this, "Redirect to login", Toast.LENGTH_LONG).show() }
the toast in never displayed when I click on the textView and drawerLayout closes.
Try like this way