when i pass a variable from the main method, my app crash : <p>im using android studio and im making an app but i have this problem when i pass the variable from my main to the class, my app crash.</p>

<p>its show me a massage that the app has stopped</p>

<p>this is how i pass the variable</p>

<pre><code> bravo b = new bravo();
        b.updatetext(Correctcounter);
</code></pre>

<p>and this is my method in the class</p>

<pre><code>public void updatetext(int x) {
   TextView scoreView = (TextView)findViewById(R.id.score);
   scoreView.setText(""+x);
}
</code></pre>
