2

多くのビューを持つ ScrollView を取得しました。アクティビティを開始すると、スクロール後に次のようになります。

04-10 20:11:42.480: E/AndroidRuntime(2089): FATAL EXCEPTION: main
04-10 20:11:42.480: E/AndroidRuntime(2089): java.lang.StackOverflowError
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.addFocusables(View.java:3654)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.addFocusables(ViewGroup.java:618)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.getFocusables(View.java:3612)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.FocusFinder.findNextFocus(FocusFinder.java:109)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.FocusFinder.findNextFocus(FocusFinder.java:93)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:476)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.focusSearch(View.java:3547)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.TextView.onCreateInputConnection(TextView.java:4662)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:945)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1129)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.inputmethod.InputMethodManager.isActive(InputMethodManager.java:542)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.TextView.onDraw(TextView.java:4173)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.draw(View.java:6933)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.draw(View.java:7039)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.ScrollView.draw(ScrollView.java:1415)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089):     at android.view.ViewGroup.drawChild(

なぜこのエラーが発生するのですか?

4

1 に答える 1

5

UI ビュー ツリーが深すぎます。 は (明らかに)レイアウト ツリーaddFocusablesに再帰的であり、Android のスタック サイズはかなり制限されています。Viewレイアウトを変更して、ネストを減らし、よりフラットなレイアウトにします。ネストせずに必要なレイアウトを取得するには、カスタム レイアウトを作成する必要がある場合があります。

于 2013-04-10T18:24:54.790 に答える