java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to android.widget.LinearLayout

Stack Overflow | Anand Kumar | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Shows ClassCastException while performing drag and drop in android

    Stack Overflow | 7 months ago | Anand Kumar
    java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to android.widget.LinearLayout

    Root Cause Analysis

    1. java.lang.ClassCastException

      android.support.v7.widget.AppCompatTextView cannot be cast to android.widget.LinearLayout

      at com.example.anandzoom.draganddrop.MainActivity.onDrag()
    2. com.example.anandzoom
      MainActivity.onDrag
      1. com.example.anandzoom.draganddrop.MainActivity.onDrag(MainActivity.java:70)
      1 frame
    3. Android Platform
      ViewRootImpl.handleDragEvent
      1. android.view.View.dispatchDragEvent(View.java:19702)
      2. android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1518)
      3. android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1518)
      4. android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1518)
      5. android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1518)
      6. android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1518)
      7. android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1518)
      8. android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1518)
      9. android.view.ViewRootImpl.handleDragEvent(ViewRootImpl.java:5290)
      9 frames