2013-05-22 3 views
4
나는 현재 내 안드로이드 프로젝트에이 라이브러리를 사용하고

:SlidingMenu 및 안드로이드 PullToRefresh 라이브러리 충돌

모든 것을 4.x의 바로 작동하지만 Android 2.x에서는 StackOverflow 예외가 발생합니다.

Android 버전 문제인지 하드웨어 문제인지 확실하지 않습니다.

05-22 13:34:30.339: E/AndroidRuntime(15179): java.lang.StackOverflowError 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.text.Styled.measureText(Styled.java:430) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.text.Layout.measureText(Layout.java:1655) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.text.Layout.getLineMax(Layout.java:689) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.text.Layout.draw(Layout.java:340) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.text.BoringLayout.draw(BoringLayout.java:365) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.TextView.onDraw(TextView.java:4259) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6880) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.FrameLayout.draw(FrameLayout.java:357) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.AbsListView.dispatchDraw(AbsListView.java:1492) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.ListView.dispatchDraw(ListView.java:3138) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6986) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.AbsListView.draw(AbsListView.java:2600) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at com.handmark.pulltorefresh.library.PullToRefreshListView$InternalListView.draw(PullToRefreshListView.java:281) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.buildDrawingCache(View.java:6642) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.onAnimationStart(ViewGroup.java:1259) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1505) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.support.v4.view.ViewPager.draw(ViewPager.java:1574) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.FrameLayout.draw(FrameLayout.java:357) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.FrameLayout.draw(FrameLayout.java:357) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at com.slidingmenu.lib.CustomViewAbove.dispatchDraw(CustomViewAbove.java:830) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.view.View.draw(View.java:6883) 
05-22 13:34:30.339: E/AndroidRuntime(15179): at android.widget.FrameLayout.draw(FrameLayout.java:357) 

누군가가 나에게 문제를 해결하는 데 도움이 될 수 있습니다 :

이것은 예외 로그는?

감사합니다.

답변

3

너무 많은 중첩 된보기가있는 경우 일반적으로이 오류가 표시됩니다. 이는 이전 버전의 Android에서 악화되는 문제입니다.

그러나 나는 또한 슬라이드 메뉴 lib가 이전 버전의 Android (3.X 또는 이전 버전)에서이 문제를 일으킬 수 있음을 알아 챘습니다. 나는 항상이 오류를 보곤했는데 슬라이딩 메뉴 코드에서 비롯되었다. 내 자신의 견해는 10-15 개의 깊이로 중첩되어 있었지만 (중대하지는 않지만 재앙이 아님) 메뉴 서랍 라이브러리 https://github.com/SimonVT/android-menudrawer으로 전환했는데 오류가 사라졌습니다. 시도

것들 ...

  1. 화재까지 안드로이드 장치 모니터 또는 계층 구조 뷰어 (http://developer.android.com/tools/debugging/debugging-ui.html)와 레이아웃을 살펴 있습니다. 말보다 더 깊은 견해가있는 경우 15-20 레이아웃을 최적화하는 것이 좋습니다.
  2. 슬라이딩 메뉴 lib를 Google의 자체 라이브러리 (지원 라이브러리에 있음) 또는 위에 언급 한 언어로 교체하십시오 (슬라이딩 메뉴와 비슷한 디자인을 따르기 때문에 쉽게 교체 할 수 있습니다. 약 1 시간이 소요되었습니다) .

행운을 빌어 요!

+0

감사합니다. @Neil. 계층 구조 뷰어를 사용하고 두 개 또는 세 개의 계층 구조 수준을 제거하여 문제를 해결했습니다 (예를 들어 단일 RelativeLayout으로 중첩 된 LinearLayouts를 변경 함). 어쨌든 두 라이브러리는 계층에 "추가"수준을 추가하므로 고려해야 할 지점입니다. – abeljus

+0

팁 주셔서 감사합니다! 나는 똑같은 문제를 겪었고, 내 견해를 개조하고, 하나 또는 두 개의 LinearLayout과 작품을 삭제했습니다! 주요 문제는 LinearLayouts였습니다. 다시 한번 고마워요, 제 하루를 구하십시오. –