title: Android StackOverflow Error
body: <p>The following is my stacktrace. I looked through it but it just shows a bunch of views and frankly I'm not too sure what a stackoverflow error is exactly. I read on some of the other questions that some solved theirs through iterations (again, no idea what those are). For the basic layout of the app this is coming from when this crashes is:</p>
  
  <p>TabView (5 tabs) > 5th tab > webview in that tab on button press. Now it does actually crash until i hit the back button to go back to the 5th tab and it doesn't do it every time.</p>
  
  <p>Thanks for the help!</p>
  
  <p>Edit: I stopped testing on the emulator and I have yet to see it crash on my phone. I will appreciate and look into any further help given but I think it was just an emulator issue.</p>
  
  <pre><code>04-20 01:52:26.510: ERROR/AndroidRuntime(23240): FATAL EXCEPTION: main
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240): java.lang.StackOverflowError
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewRoot.checkThread(ViewRoot.java:2801)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewRoot.requestChildFocus(ViewRoot.java:1567)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestChildFocus(ViewGroup.java:431)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestChildFocus(ViewGroup.java:431)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestChildFocus(ViewGroup.java:431)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestChildFocus(ViewGroup.java:431)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestChildFocus(ViewGroup.java:431)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestChildFocus(ViewGroup.java:431)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.handleFocusGainInternal(View.java:2486)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.requestFocus(View.java:3605)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.requestFocus(View.java:3556)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.requestFocus(View.java:3534)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabWidget.onFocusChange(TabWidget.java:425)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.onFocusChanged(View.java:2666)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.handleFocusGainInternal(View.java:2489)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:405)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.requestFocus(View.java:3605)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestFocus(ViewGroup.java:1028)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1073)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.requestFocus(ViewGroup.java:1029)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.requestFocus(View.java:3556)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:121)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.widget.TabHost$1.onKey(TabHost.java:122)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.View.dispatchKeyEvent(View.java:3735)
  04-20 01:52:26.510: ERROR/AndroidRuntime(23240):     at android.view.ViewGroup.d
  </code></pre>
  
  <p>Edit: Posting code on crash.</p>
  
  <pre><code>public class TwitterAuthUrl extends Activity {
  
      final static String TAG = "TwitterAuthUrl";
      WebView mWebView;
  
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          setContentView(R.layout.twitterauthurl);
          Bundle extras = getIntent().getExtras();
  
          OAuthConsumer consumer = new DefaultOAuthConsumer("xxxxxxxxxxxxxxxxxxxxx",
          "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
  
          OAuthProvider provider = new DefaultOAuthProvider(
          "http://twitter.com/oauth/request_token",
          "http://twitter.com/oauth/access_token",
          "http://twitter.com/oauth/authorize");
  
  
          String authUrl = null;
          try {
              authUrl = provider.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND);
              Log.d(TAG, "Success authUrl " + authUrl);
          } catch (OAuthMessageSignerException e) {
              e.printStackTrace();
          } catch (OAuthNotAuthorizedException e) {
              e.printStackTrace();
          } catch (OAuthExpectationFailedException e) {
              e.printStackTrace();
          } catch (OAuthCommunicationException e) {
              e.printStackTrace();
          }
  
          mWebView = (WebView) findViewById(R.id.webview);
          mWebView.getSettings().setJavaScriptEnabled(true);
          mWebView.loadUrl(authUrl);
          Log.d(TAG, "authUrl = " + authUrl);
  
      }
  }
  </code></pre>
  
  <p>The XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;WebView  xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/webview"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
      /&gt;
  </code></pre>