How to get view from drawer header layout with binding in activity(Navigation Drawer) .
Solution 1 :
NavigationView navigationView = (NavigationView) findViewById(R.id.navigation);
View headerView = navigationView.inflateHeaderView(R.layout.header_layout)
ImageView iv = (ImageView)headerview.findViewById(...
Solution 2:NavigationView navigationView = (NavigationView) findViewById(R.id.navigation);
View headerView = LayoutInflater.from(this).inflate(R.layout.header_layout, navigationView, false);
navigationView.addHeaderView(view);
ImageView iv = (ImageView) headerView.findViewById(...)
No comments :
Post a Comment