java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity

GitHub | Dharmaraj | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    android:theme tag is not allowed in layout file.

    GitHub | 6 months ago | Dharmaraj
    java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity
  2. 0

    Documentation or implementation bug. Custom ViewHolder cannot be cast to eu.davidea.viewholders.FlexibleViewHolder

    GitHub | 8 months ago | ivankarpey
    java.lang.ClassCastException: Fragments.HeaderViewHolder cannot be cast to eu.davidea.viewholders.FlexibleViewHolder

    Root Cause Analysis

    1. java.lang.ClassCastException

      android.view.ContextThemeWrapper cannot be cast to android.app.Activity

      at eu.davidea.flexibleadapter.FlexibleAdapter.getStickySectionHeadersHolder()
    2. eu.davidea.flexibleadapter
      StickyHeaderHelper$1.run
      1. eu.davidea.flexibleadapter.FlexibleAdapter.getStickySectionHeadersHolder(FlexibleAdapter.java:975)
      2. eu.davidea.flexibleadapter.helpers.StickyHeaderHelper.initStickyHeadersHolder(StickyHeaderHelper.java:113)
      3. eu.davidea.flexibleadapter.helpers.StickyHeaderHelper.access$000(StickyHeaderHelper.java:41)
      4. eu.davidea.flexibleadapter.helpers.StickyHeaderHelper$1.run(StickyHeaderHelper.java:79)
      4 frames
    3. Android Platform
      ActivityThread.main
      1. android.os.Handler.handleCallback(Handler.java:739)
      2. android.os.Handler.dispatchMessage(Handler.java:95)
      3. android.os.Looper.loop(Looper.java:145)
      4. android.app.ActivityThread.main(ActivityThread.java:6873)
      4 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
      2 frames