java.lang.ClassCastException: my.package.adapter.ChildViewHolder cannot be cast to my.package.adapter.GroupViewHolder


Solutions on the web1

Solution icon of github
my.package.adapter.ChildViewHolder cannot be cast to my.package.adapter.GroupViewHolder

Stack trace

java.lang.ClassCastException: my.package.adapter.ChildViewHolder cannot be cast to my.package.adapter.GroupViewHolder
	at my.package.adapter.MyAdapter.onCheckCanExpandOrCollapseGroup(SourceFile:44)
	at com.h6ah4i.android.widget.advrecyclerview.expandable.ExpandableRecyclerViewWrapperAdapter.onTapItem(SourceFile:593)
	at com.h6ah4i.android.widget.advrecyclerview.expandable.RecyclerViewExpandableItemManager.handleActionUpOrCancel(SourceFile:286)
	at com.h6ah4i.android.widget.advrecyclerview.expandable.RecyclerViewExpandableItemManager.onInterceptTouchEvent(SourceFile:222)
	at com.h6ah4i.android.widget.advrecyclerview.expandable.RecyclerViewExpandableItemManager$1.onInterceptTouchEvent(SourceFile:95)
	at android.support.v7.widget.RecyclerView.dispatchOnItemTouchIntercept(SourceFile:2231)
	at android.support.v7.widget.RecyclerView.onInterceptTouchEvent(SourceFile:2277)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1935)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2289)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2032)
	at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2026)
	at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1476)
	at android.app.Activity.dispatchTouchEvent(Activity.java:2473)
	at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(SourceFile:60)
	at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(SourceFile:60)
	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1974)
	at android.view.View.dispatchPointerEvent(View.java:7396)
	at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3250)
	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3195)
	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4237)
	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4216)
	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4308)
	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
	at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
	at android.os.MessageQueue.next(MessageQueue.java:125)
	at android.os.Looper.loop(Looper.java:124)
	at android.app.ActivityThread.main(ActivityThread.java:4914)
	at java.lang.reflect.Method.invokeNative(Method.java)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:808)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:575)
	at dalvik.system.NativeStart.main(NativeStart.java)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.