In my NavigationView I have a header layout with id 'viewId' with active buttons. To setup those buttons, I do the following in activity's onPostCreate
:
final View panel = findViewById(R.id.viewId);
panel.setOnClickListener(new View.OnClickListener() {
... setup goes here ...
});
With new version android support library, (23.1.0), the view can't be found, it returns null. With previous versions it worked well. Is it a bug or am I using this feature wrong? If so, how to access header layout and add behavior to it?
OnLayoutChangeListener
requires min sdk level 11, but I have 9 in my app. Any ideas please, how to workaroundfindViewById
returningnull
forNavigationView
header? – Maricruzmaridel