call a method in an activity from a "normal" class
<p>I have one main activity that handles all the UI stuff. In the activity i have a <code>ListView</code> which is in a <code>SlidingDrawer</code>, above that are 4 <code>TextView</code>s.
I want to change the text of the 4 <code>TextView</code>s once i click on an item from the <code>ListView</code>.
I get the text from an online database, so i put the code for that in an extra class.
I created a reference to the workerclass:</p>

<pre><code>final OneTopic ot = new OneTopic();
</code></pre>

<p>In my onClickListener I call the method from the workerclass</p>

<pre><code>ot.postData(position);
</code></pre>

<p>At the beginning of the workerclass i have a reference to the main class</p>

<pre><code>Main main = new Main();
</code></pre>

<p>when the worker class is finished, it calls the method that updates the UI in the Activity.</p>

<pre><code>main.displayText(body, title, date, poster);
</code></pre>

<p>The method its calling looks like this:<br></p>

<pre><code>public void displayText(String body, String title, String date, String poster) {
    tx_body.setText(Html.fromHtml(body));
    tx_title.setText(title);
    tx_date.setText(date);
    tx_poster.setText(poster);
}
</code></pre>

<p>If I do this my app force closes once it tries to set the text.<br>
<br>
What am I doing wrong?</p>
