我开发了一个应用程序,其中有4个选项卡A,B,C,D。每个选项卡都包含一个活动。在第四个选项卡中,DI添加了一个ActivityGroup,其中包含WebView。我在第四个Tab中有另外3个活动X,Y,Z,我添加了活动组,我得到StackOverflow错误。请帮我解决这个问题。错误。
下面是我的xml布局代码,我必须知道我的格式是否正确。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="3dp"
android:paddingTop="3dp" >
<EditText
android:id="@+id/weblink"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="3dp"
android:layout_weight="2"
android:background="@drawable/shape"
android:hint="Enter Address"
android:imeOptions="actionGo"
android:padding="5dp"
android:singleLine="true" />
<EditText
android:id="@+id/websearch"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="@drawable/shape"
android:hint="Search"
android:imeOptions="actionGo"
android:padding="5dp"
android:singleLine="true" />
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" >
<WebView
android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</WebView>
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical|center_horizontal"
android:visibility="gone" />
</FrameLayout>
<ImageView
android:id="@+id/mp3link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/clickhere"
android:visibility="gone" />
<LinearLayout
android:id="@+id/player_footer_bg"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@drawable/centerbg"
android:gravity="center"
android:orientation="vertical"
android:padding="5dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/home"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/home" />
<ImageView
android:id="@+id/back"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_weight="1"
android:src="@drawable/webbackbtn" />
<ImageView
android:id="@+id/forward"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_weight="1"
android:src="@drawable/webfrwdbtn" />
<ImageView
android:id="@+id/reload"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="60dp"
android:layout_weight="1"
android:src="@drawable/refresh" />
</LinearLayout>
</LinearLayout>
使用该webview时,我的logcat产生以下错误
04-01 14:26:12.667: E/AndroidRuntime(30005): FATAL EXCEPTION: main
04-01 14:26:12.667: E/AndroidRuntime(30005): java.lang.StackOverflowError
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.getChildVisibleRect(ViewGroup.java:4586)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getGlobalVisibleRect(View.java:10646)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.webkit.WebViewClassic.calcOurVisibleRect(WebViewClassic.java:5299)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.webkit.WebViewClassic.calcOurContentVisibleRectF(WebViewClassic.java:5325)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.webkit.WebViewClassic.drawContent(WebViewClassic.java:6625)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.webkit.WebViewClassic.onDraw(WebViewClassic.java:6756)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.webkit.WebView.onDraw(WebView.java:2186)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.draw(View.java:14541)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13476)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13520)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.draw(View.java:14254)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.drawChild(ViewGroup.java:3155)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3024)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13474)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13520)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.draw(View.java:14254)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.drawChild(ViewGroup.java:3155)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3024)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13474)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13520)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.draw(View.java:14254)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.drawChild(ViewGroup.java:3155)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3024)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13474)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13520)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.draw(View.java:14254)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.drawChild(ViewGroup.java:3155)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3024)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13474)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13520)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.draw(View.java:14254)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.drawChild(ViewGroup.java:3155)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3024)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13474)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.getDisplayList(View.java:13520)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.View.draw(View.java:14254)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.drawChild(ViewGroup.java:3155)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3024)
04-01 14:26:12.667: E/AndroidRuntime(30005): at android.view