java.lang.ClassCastException: android.widget.ImageView cannot be cast to uk.co.senab.photoview.PhotoView

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by wenmingvs
, 1 year ago
android.widget.ImageView cannot be cast to uk.co.senab.photoview.PhotoView
via GitHub by wenmingvs
, 1 year ago
android.widget.ImageView cannot be cast to uk.co.senab.photoview.PhotoView
java.lang.ClassCastException: android.widget.ImageView cannot be cast to uk.co.senab.photoview.PhotoView
at com.wenming.weiswift.ui.login.fragment.home.userdetail.adapter.UserPhotoAdapter$ViewHolder.(UserPhotoAdapter.java:79)
at com.wenming.weiswift.ui.login.fragment.home.userdetail.adapter.UserPhotoAdapter.onCreateViewHolder(UserPhotoAdapter.java:46)
at com.wenming.weiswift.ui.login.fragment.home.userdetail.adapter.UserPhotoAdapter.onCreateViewHolder(UserPhotoAdapter.java:23)
at com.wenming.weiswift.widget.endlessrecyclerview.HeaderAndFooterRecyclerViewAdapter.onCreateViewHolder(HeaderAndFooterRecyclerViewAdapter.java:165)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5464)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4689)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4599)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1988)
at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:528)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1347)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574)
at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3003)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2881)
at android.view.View.layout(View.java:16100)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.view.View.layout(View.java:16100)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
at android.view.View.layout(View.java:16100)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16100)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
at android.view.View.layout(View.java:16100)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at com.wenming.swipebacklayout.SwipeBackLayout.onLayout(SwipeBackLayout.java:402)
at android.view.View.layout(View.java:16100)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16100)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2587)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2281)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1329)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6780)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:818)
at android.view.Choreographer.doCallbacks(Choreographer.java:621)
at android.view.Choreographer.doFrame(Choreographer.java:584)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:804)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5691)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)

Users with the same issue

You are the first who have seen this exception.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.