title: How to apply onClickListener in navigationView?
body: <p>I want to add an <strong><code>onClickListener</code></strong> to navigation view header's items like I have made Login or Register buttons there and I want to add Listener to the navigationView.</p>
  
  <p>So, that when I click to the navigationView, my login activity would open. And I have been using Navigation Drawer Activity for this and I have done this coding  in MainActivity.</p>
  
  <p>Please tell me how to do so.</p>
  
  <p>I have simply make an object of navigtionView and then apply Listener to it there is no error but it is not working</p>
  
  <pre><code>setContentView(R.layout.activity_main);
  nav_view = (NavigationView) findViewById(R.id.nav_view);
  nav_view.setOnClickListener(this);
  
  @Override
  public void onClick(View v) {
      Intent i=new Intent(MainActivity.this,Login.class);
      startActivity(i);
  }
  </code></pre>