title: Change the NavigationView's header title
body: <p>I have a <code>NavigationView</code> nested inside a <code>DrawerLayout</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/wwgnM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wwgnM.png" alt="enter image description here"></a></p>
  
  <p><strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
  android:id="@+id/drawer_layout"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true"&gt;
  
  .......
  
  &lt;android.support.design.widget.NavigationView
      android:id="@+id/navigation_view"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      app:headerLayout="@layout/drawer_header"
      app:menu="@menu/drawer"/&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>drawer_header.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="150dp"
                android:background="?attr/colorPrimaryDark"
                android:gravity="bottom"
                android:orientation="vertical"
                android:padding="16dp"
                android:theme="@style/ThemeOverlay.AppCompat.Dark"&gt;
  
      &lt;TextView
          android:id="@+id/drawerHeaderTitle"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="@string/drawer_header_text"
          android:textAppearance="@style/TextAppearance.AppCompat.Body1"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>How can I access the drawer header's title in Java code ?
  I tried to:</p>
  
  <ol>
  <li><p>access it directly using its <code>id</code> (<strong><em>drawerHeaderTitle</em></strong>) but I get a <code>NullPointerException</code></p></li>
  <li><p>access it via the <code>NavigationView.findViewById</code>: same error</p></li>
  </ol>
  
  <p>How can I overcome this problem ?</p>