Tuesday, 9 May 2017

How to get view from drawer header layout with binding in activity(Navigation Drawer) .

  No comments
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

Loading...