can't access to TextView
<p>I have MainActivite. And I try to set text to TextView tvUserName.
Until today everything was Ok, but now I can't access to this variable by findViewById. Value of this variable is null.</p>

<p>Maybe it's a wrong code, and it's stopped to work correctly after system libs update.</p>

<p>I didn't do anything special, and don't understand what to do.</p>

<pre><code>Caused by: java.lang.NullPointerException
</code></pre>

<p>when I try to set text to this variable</p>

<pre><code>private static TextView tvUserName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        currentLocale = getResources().getConfiguration().locale;
        LocaleHelper.onCreate(this, currentLocale + "");
        setContentView(R.layout.activity_main);

        context = this;

        fragmentManager = getSupportFragmentManager();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(MainActivity.this);
        navigationView.setEnabled(false);

        DrawerLayout mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        mDrawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

        tvUserName = (TextView) findViewById(R.id.navUserName);

        //?????
    }
</code></pre>

<p>---------  activity_main.xml ------------------</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"&gt;

    &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout"
        android:layout_width="match_parent" android:layout_height="match_parent"
        android:fitsSystemWindows="true" tools:openDrawer="start"&gt;

                &lt;include layout="@layout/app_bar_main" android:layout_width="match_parent"
                    android:layout_height="match_parent" /&gt;

            &lt;android.support.design.widget.NavigationView android:id="@+id/nav_view"
                android:layout_width="wrap_content" android:layout_height="match_parent"
                android:layout_gravity="start" android:fitsSystemWindows="true"
                app:headerLayout="@layout/nav_header_main" app:menu="@menu/activity_main_drawer"/&gt;

        &lt;/android.support.v4.widget.DrawerLayout&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>------- nav_header_main -----------------</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="wrap_content"
    android:paddingLeft="16dp"
    android:background="@drawable/side_nav_bar"
    android:theme="@style/ThemeOverlay.AppCompat.Dark" android:orientation="vertical"
    android:gravity="bottom"&gt;

    &lt;TextView android:layout_width="match_parent" android:layout_height="wrap_content"
        android:paddingTop="@dimen/nav_header_vertical_spacing" android:text="Phone4Pay"
        android:textAppearance="@style/TextAppearance.AppCompat.Body1" /&gt;
    &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="2dp"
        android:paddingBottom="15dp" &gt;
        &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:id="@+id/navUserName"/&gt;

    &lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>