Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
  2. TextView text = (TextView) drawer.findViewById(R.id.textViewNames);
  3. text.setText("HELLO");
  4.  
  5. NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
  6. try{
  7. View header = LayoutInflater.from(this).inflate(R.layout.nav_header_profiler, null);
  8. navigationView.addHeaderView(header);
  9. TextView text = (TextView) header.findViewById(R.id.textViewNames);
  10. text.setText("HELLO");
  11.  
  12. }catch (Exception e){
  13. Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_LONG).show();
  14. }
  15.  
  16. @SuppressWarnings("StatementWithEmptyBody")
  17. @Override
  18. public boolean onNavigationItemSelected(MenuItem item) {
  19.  
  20. TextView textView = (TextView) findViewById(R.id.textViewNames);
  21. textView.setText(LoginActivity.FIRST_NAME + "n" + LoginActivity.LAST_NAME);
  22.  
  23. // Handle navigation view item clicks here.
  24. int id = item.getItemId();
  25.  
  26. if (id == R.id.nav_camera) {
  27. // Handle the camera action
  28. } else if (id == R.id.nav_gallery) {
  29.  
  30. } else if (id == R.id.nav_slideshow) {
  31.  
  32. } else if (id == R.id.nav_manage) {
  33.  
  34. } else if (id == R.id.Find) {
  35.  
  36. } else if (id == R.id.LogOut) {
  37.  
  38. }
  39.  
  40.  
  41. DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
  42. drawer.closeDrawer(GravityCompat.START);
  43. return true;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement