Cannot make a static reference to a non-static method - Android TabbedActivity
<p>I'm new to Java and Android developing and I can't fix an error. I want to change the text of a <code>TextView</code> with a variable but the view class is static. Here's the code:</p>

<pre><code>    public static class FirstTab extends Fragment {

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.first_tab, null);

        new Thread() {
            public void run() {

                MCQuery mcQuery = new MCQuery(serverAddress, 25565);
                QueryResponse response = mcQuery.basicStat();
                int Onlineplayers = response.getOnlinePlayers();
                Log.d("MCQuery", "" + Onlineplayers + " Online Players");

            }
        }.start();

        TextView onlinePlayersView = (TextView) findViewById(R.id.online_players);
        onlinePlayersView.setText(Onlineplayers);

        return v;
    }
}
</code></pre>

<p>The error is: "Cannot make a static reference to the non-static method <code>findViewById(int)</code> from the type Activity"</p>

<p>How can I solve this problem?</p>
