What am I forgetting about OnClickListener?
<p>I'm knocking together what amounts to an RSS reader in Android, and I'm having a problem with onClickListener.</p>

<p>The following code run fine outside of the onClickListener, but as soon as I move it inside the class it </p>

<pre><code>        topNewsbtn = (Button) findViewById(R.id.newsTop);

    topNewsbtn.setOnClickListener(new OnClickListener(){


        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            Intent itemintent = new Intent(that,RSSReader.class);
            Bundle b = new Bundle();
            b.putString("FeedURL", "http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989");
            itemintent.putExtra("android.intent.extra.INTENT", b);
            startActivity(itemintent);
        }


    }); 
</code></pre>

<p>N.B. that is defined in the Activity as a Context and within onCreate assigned as that = this</p>

<p>On execution the app crashed on start-up with the following stack trace (nothing in LogCat) </p>

<pre><code>Thread [&lt;1&gt; main] (Suspended (exception java.lang.RuntimeException))    
    &lt;VM does not provide monitor information&gt;   
    android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityRecord, android.content.Intent) line: 2663  
    android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityRecord, android.content.Intent) line: 2679   
    android.app.ActivityThread.access$2300(android.app.ActivityThread, android.app.ActivityThread$ActivityRecord, android.content.Intent) line: 125 
    android.app.ActivityThread$H.handleMessage(android.os.Message) line: 2033   
    android.app.ActivityThread$H(android.os.Handler).dispatchMessage(android.os.Message) line: 99   
    android.os.Looper.loop() line: 123  
    android.app.ActivityThread.main(java.lang.String[]) line: 4627  
    java.lang.reflect.Method.invokeNative(java.lang.Object, java.lang.Object[], java.lang.Class, java.lang.Class[], java.lang.Class, int, boolean) line: not available [native method]  
    java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 521    
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() line: 868  
    com.android.internal.os.ZygoteInit.main(java.lang.String[]) line: 626   
    dalvik.system.NativeStart.main(java.lang.String[]) line: not available [native method]  
</code></pre>

<p>I have another onClickListener that also crashes with the same sort of stack trace and that looks like</p>

<pre><code>        watchLivebtn =(Button) findViewById(R.id.Live);
    watchLivebtn.setOnClickListener(new OnClickListener(){
        public void onClick(View arg0) {
            WebView browser = (WebView)findViewById(R.id.watchnowElement);

            String HTML = "Just some HTML I want to display";
            browser.loadData(HTML, "text/html", "UTF-8");

            setContentView(R.layout.watchnow);

        }
    });
</code></pre>

<p>So clearly I'm doing something that wrong with the setOnClickListener, but what?</p>

<p>Thanks.</p>

<p><strong>update</strong></p>

<p>I resisted puting the whole class in because it's so long, as the two people who've tryed to help me (Thanks) have pointed out stuff I've don't I'll post the whole thing to help you all help me.</p>

<pre><code>import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.SlidingDrawer;


public class AJE extends Activity {

Button news_slideHandleButton;
SlidingDrawer news_slidingDrawer;


Button topNewsbtn;
Button watchLivebtn;

Context that;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    that = this;
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    news_slideHandleButton = (Button) findViewById(R.id.news_slideHandleButton);
    news_slidingDrawer = (SlidingDrawer) findViewById(R.id.news_SlidingDrawer);


    topNewsbtn = (Button) findViewById(R.id.newsTop);

    topNewsbtn.setOnClickListener(new OnClickListener(){


        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            Intent itemintent = new Intent(that,RSSReader.class);
            Bundle b = new Bundle();
            b.putString("FeedURL", "http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989");
            itemintent.putExtra("android.intent.extra.INTENT", b);
            startActivity(itemintent);
        }


    }); 

    watchLivebtn =(Button) findViewById(R.id.Live);
    watchLivebtn.setOnClickListener(new OnClickListener(){
        public void onClick(View arg0) {
            WebView browser = (WebView)findViewById(R.id.watchnowElement);

            String HTML = "&lt;html&gt;&lt;body&gt;&lt;script src='http://admin.brightcove.com/js/BrightcoveExperiences.js' type='text/javascript'&gt;&lt;/script&gt;" +
                          "&lt;script src='/custom/brightcove/aje_bc.js' type='text/javascript'&gt;&lt;/script&gt;"+
                          "&lt;div style='text-align: left; padding-bottom: 20px;'&gt;" +
                          "&lt;div id='BCplayerArea' style='width: 680px; height: 420px;'&gt;&lt;object class='BrightcoveExperience' id='myExperience747084146001' data='http://c.brightcove.com/services/viewer/federated_f9?&amp;amp;width=680&amp;amp;height=440&amp;amp;flashID=myExperience747084146001&amp;amp;bgcolor=%23FFFFFF&amp;amp;playerID=751182905001&amp;amp;playerKey=AQ~~%2CAAAAmtVJIFk~%2CTVGOQ5ZTwJYW4Aj2VxnKEXntSbmcf9ZQ&amp;amp;isVid=true&amp;amp;isUI=true&amp;amp;dynamicStreaming=true&amp;amp;%40videoPlayer=747084146001&amp;amp;autoStart=' type='application/x-shockwave-flash' width='680' height='440'&gt;&lt;param value='always' name='allowScriptAccess'&gt;&lt;param value='true' name='allowFullScreen'&gt;&lt;param value='false' name='seamlessTabbing'&gt;&lt;param value='true' name='swliveconnect'&gt;&lt;param value='window' name='wmode'&gt;&lt;param value='high' name='quality'&gt;&lt;param value='#FFFFFF' name='bgcolor'&gt;&lt;/object&gt;&lt;/div&gt;"+
                          "&lt;script type='text/javascript'&gt;// &lt;![CDATA["+
                          "RenderScVideo('747084146001','751182905001',680,440,'BCplayerArea');"+ 
                          "brightcove.createExperiences();    // ]]&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;';";
            browser.loadData(HTML, "text/html", "UTF-8");

            setContentView(R.layout.watchnow);

        }
    });

    setContentView(R.layout.start);
    }
}
</code></pre>
