Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
- TextView text = (TextView) drawer.findViewById(R.id.textViewNames);
- text.setText("HELLO");
- NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
- try{
- View header = LayoutInflater.from(this).inflate(R.layout.nav_header_profiler, null);
- navigationView.addHeaderView(header);
- TextView text = (TextView) header.findViewById(R.id.textViewNames);
- text.setText("HELLO");
- }catch (Exception e){
- Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_LONG).show();
- }
- @SuppressWarnings("StatementWithEmptyBody")
- @Override
- public boolean onNavigationItemSelected(MenuItem item) {
- TextView textView = (TextView) findViewById(R.id.textViewNames);
- textView.setText(LoginActivity.FIRST_NAME + "n" + LoginActivity.LAST_NAME);
- // Handle navigation view item clicks here.
- int id = item.getItemId();
- if (id == R.id.nav_camera) {
- // Handle the camera action
- } else if (id == R.id.nav_gallery) {
- } else if (id == R.id.nav_slideshow) {
- } else if (id == R.id.nav_manage) {
- } else if (id == R.id.Find) {
- } else if (id == R.id.LogOut) {
- }
- DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
- drawer.closeDrawer(GravityCompat.START);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement