Android TextView
<p>Hi I'm new to Android Programming and I'm trying to make a simple program that changes the text by clicking a button. Here's my code:</p>

<pre><code>public class HelloAndroidActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final Button button_scan = (Button) findViewById(R.id.button_scan);

        button_scan.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                buttonBeenPressed();
        }
        });

       }

public void buttonBeenPressed(){

    final Button button_scan = (Button) findViewById(R.id.button_scan);
    TextView tv_barcode = (TextView)findViewById(R.id.textview_barcode);
    if (tv_barcode != null){
    tv_barcode.setText("been pressed.");
    } else {
        button_scan.setText("it's null dawg.");
    }
    }
}
</code></pre>

<p>And my XML:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    &gt;
    &lt;Button android:text="Scan" android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/button_scan"&gt;&lt;/Button&gt;
    &lt;TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="TextView" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/textview_barcode"&gt;&lt;/TextView&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>However the TextView is returning NULL and i don't know why. Any suggestions? Thanks.</p>
