2016-06-07 1 views
2

나는 java.lang.IllegalStateException: Layout state should be one of 100 but it is 10 오류가 있습니다. 오류 정보는 아래에 있습니다.오류를 수정하는 방법 "java.lang.IllegalStateException : 레이아웃 상태는 100 중 하나 여야하지만 10입니다"?

E/AndroidRuntime: FATAL EXCEPTION: main 
java.lang.IllegalStateException: Layout state should be one of 100 but it is 10 
at android.support.v7.widget.RecyclerView$State.assertLayoutStep(RecyclerView.java:10053) 
at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3045) 
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2917) 
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3283) 
at android.view.View.layout(View.java:13916) 
at android.view.ViewGroup.layout(ViewGroup.java:4424) 
at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:596) 
at android.view.View.layout(View.java:13916) 
at android.view.ViewGroup.layout(ViewGroup.java:4424) 
at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 
at android.view.View.layout(View.java:13916) 
at android.view.ViewGroup.layout(ViewGroup.java:4424) 
at android.support.v7.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:437) 
at android.view.View.layout(View.java:13916) 
at android.view.ViewGroup.layout(ViewGroup.java:4424) 
at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 
at android.view.View.layout(View.java:13916) 
at android.view.ViewGroup.layout(ViewGroup.java:4424) 
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655) 
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513) 
at android.widget.LinearLayout.onLayout(LinearLayout.java:1426) 
at android.view.View.layout(View.java:13916) 
at android.view.ViewGroup.layout(ViewGroup.java:4424) 
at android.widget.FrameLayout.onLayout(FrameLayout.java:448) 
at android.view.View.layout(View.java:13916) 
at android.view.ViewGroup.layout(ViewGroup.java:4424) 
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2029) 
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1850) 
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1143) 
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4667) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) 
at android.view.Choreographer.doCallbacks(Choreographer.java:555) 
at android.view.Choreographer.doFrame(Choreographer.java:525) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) 
at android.os.Handler.handleCallback(Handler.java:615) 
at android.os.Handler.dispatchMessage(Handler.java:92) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:4960) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:511) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) 
at dalvik.system.NativeStart.main(Native Method) 

제발,이 오류를 해결하는 데 도움이됩니다. 감사합니다

+6

멋진 이야기 형. 그게 무슨 문제 야? – Tom

+0

지원 라이브러리 24로 업그레이드 한 후에도 비슷한 예외가 있습니다. 이전에는 제대로 작동했습니다. – Embydextrous

답변

1

나는 거의 비슷한 오류 로그를 가지고 있습니다. 필자의 경우 TextView가 .xml이지만 Adapter.java의 Button에 캐스팅되었습니다.

TextView tv = (TextView) convertView.findViewById(R.id.button_id); // wrong 

이 오류

을 재현 할 수 있습니다. 버튼을 TextView로 변환 할 때 발생하지 않습니다.

-2

나는이 오류도 만났습니다. classCastException에 의해 발생하는 onBindViewHolder 메서드로 인해서 오류가 발생했습니다. 그러나이 예외 스택에는 명확하게 나와 있지 않습니다.

나는 이것이 도움이 될 것이라고 생각합니다.

+0

이것은 실제로 질문에 대답하지 않습니다. 다른 질문이있는 경우 [질문하기] (https://stackoverflow.com/questions/ask)를 클릭하여 질문 할 수 있습니다. [평판] (https://stackoverflow.com/help/privileges/set-bounties)을 충분히 확보하면 [현상금 추가] (https://stackoverflow.com/help/privileges/set-bounties)를 통해이 질문에 더 집중할 수 있습니다. 평판). - [From Review] (리뷰/저품절 게시물/17927367) – Popeye

관련 문제