java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.TextView

Stack Overflow | BABLU KUMAR | 10 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

    Closed - Toast message does not show up

    Stack Overflow | 10 months ago | BABLU KUMAR
    java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.TextView

    Root Cause Analysis

    1. java.lang.ClassCastException

      android.widget.LinearLayout cannot be cast to android.widget.TextView

      at com.example.hacback17.listviewwithinflater.MainActivity.onItemClick()
    2. com.example.hacback17
      MainActivity.onItemClick
      1. com.example.hacback17.listviewwithinflater.MainActivity.onItemClick(MainActivity.java:32)
      1 frame
    3. Android Platform
      ActivityThread.main
      1. android.widget.AdapterView.performItemClick(AdapterView.java:299)
      2. android.widget.AbsListView.performItemClick(AbsListView.java:1115)
      3. android.widget.AbsListView$PerformClick.run(AbsListView.java:2928)
      4. android.widget.AbsListView$3.run(AbsListView.java:3691)
      5. android.os.Handler.handleCallback(Handler.java:733)
      6. android.os.Handler.dispatchMessage(Handler.java:95)
      7. android.os.Looper.loop(Looper.java:136)
      8. android.app.ActivityThread.main(ActivityThread.java:5113)
      8 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:515)
      2 frames
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
      2 frames
    6. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame