java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

Stack Overflow | Sathya Baman | 5 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Switching layout inside the recyclerview for chat application

    Stack Overflow | 5 months ago | Sathya Baman
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

      at zupportdesk.desk.zupport.chatsystem.Data.ChattingAdapter.onBindViewHolder()
    2. zupportdesk.desk.zupport
      ChattingAdapter.onBindViewHolder
      1. zupportdesk.desk.zupport.chatsystem.Data.ChattingAdapter.onBindViewHolder(ChattingAdapter.java:66)
      1 frame
    3. Android v7
      RecyclerView.onLayout
      1. android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:5822)
      2. android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:5855)
      3. android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5091)
      4. android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4967)
      5. android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2029)
      6. android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1414)
      7. android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377)
      8. android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:578)
      9. android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3315)
      10. android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3124)
      11. android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3568)
      11 frames
    4. Android Platform
      FrameLayout.onLayout
      1. android.view.View.layout(View.java:16636)
      2. android.view.ViewGroup.layout(ViewGroup.java:5437)
      3. android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
      4. android.view.View.layout(View.java:16636)
      5. android.view.ViewGroup.layout(ViewGroup.java:5437)
      6. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
      7. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
      8. android.view.View.layout(View.java:16636)
      9. android.view.ViewGroup.layout(ViewGroup.java:5437)
      10. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735)
      11. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579)
      12. android.widget.LinearLayout.onLayout(LinearLayout.java:1488)
      13. android.view.View.layout(View.java:16636)
      14. android.view.ViewGroup.layout(ViewGroup.java:5437)
      15. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
      16. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
      17. android.view.View.layout(View.java:16636)
      18. android.view.ViewGroup.layout(ViewGroup.java:5437)
      19. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735)
      20. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579)
      21. android.widget.LinearLayout.onLayout(LinearLayout.java:1488)
      22. android.view.View.layout(View.java:16636)
      23. android.view.ViewGroup.layout(ViewGroup.java:5437)
      24. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
      25. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
      25 frames
    5. Android
      PhoneWindow$DecorView.onLayout
      1. com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
      1 frame
    6. Android Platform
      ActivityThread.main
      1. android.view.View.layout(View.java:16636)
      2. android.view.ViewGroup.layout(ViewGroup.java:5437)
      3. android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2179)
      4. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1939)
      5. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1115)
      6. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6023)
      7. android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
      8. android.view.Choreographer.doCallbacks(Choreographer.java:670)
      9. android.view.Choreographer.doFrame(Choreographer.java:606)
      10. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
      11. android.os.Handler.handleCallback(Handler.java:739)
      12. android.os.Handler.dispatchMessage(Handler.java:95)
      13. android.os.Looper.loop(Looper.java:148)
      14. android.app.ActivityThread.main(ActivityThread.java:5422)
      14 frames
    7. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    8. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
      2 frames