Reference to TextView object from nested class
<p>I'm new to Android programming and probably I don;t understand Java very well yet, so i got this problem with my program.
Every time I press button on my menu I get the <strong>java.lang.NullPointerException</strong>. 
Is there any way to reference to this TextView object and change its text when <strong>item2</strong> on menu is clicked?</p>

<pre><code>public class MainActivity extends Activity {

TextView tv;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MainActivity.this.tv = (TextView) findViewById(R.id.tekst1);
    setContentView(R.layout.activity_main);

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.mymenu, menu);
    return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.item2) {
        MainActivity.this.tv.setText("aaa");
    }
    return super.onOptionsItemSelected(item);
}
}
</code></pre>

<p>EDIT:
mymenu xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;

&lt;item
    android:id="@+id/item1"
    android:icon="@android:drawable/ic_menu_week"
    android:title="Option 1"/&gt;
&lt;item
    android:id="@+id/item2"
    android:icon="@android:drawable/ic_menu_month"
    android:title="Option 2"/&gt;

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

<p>activity_main.xml</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" &gt;

&lt;TextView
    android:id="@+id/tekst1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="@string/hello_world"
    tools:context=".MainActivity" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>
