java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference

Stack Overflow | Dr.Android | 4 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

    How to put a recyclerview inside a recyclerView in android

    Stack Overflow | 4 months ago | Dr.Android
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference

      at com.daprlabs.aaron.swipedeck2.CardInfo.HoursActivity$HoursRecyclerViewAdapter$MyViewHolder.<init>()
    2. com.daprlabs.aaron
      HoursActivity$HoursRecyclerViewAdapter.onCreateViewHolder
      1. com.daprlabs.aaron.swipedeck2.CardInfo.HoursActivity$HoursRecyclerViewAdapter$MyViewHolder.<init>(HoursActivity.java:97)
      2. com.daprlabs.aaron.swipedeck2.CardInfo.HoursActivity$HoursRecyclerViewAdapter.onCreateViewHolder(HoursActivity.java:73)
      3. com.daprlabs.aaron.swipedeck2.CardInfo.HoursActivity$HoursRecyclerViewAdapter.onCreateViewHolder(HoursActivity.java:57)
      3 frames
    3. Android v7
      RecyclerView.onMeasure
      1. android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5836)
      2. android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5060)
      3. android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4970)
      4. android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2029)
      5. android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1414)
      6. android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377)
      7. android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:578)
      8. android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3315)
      9. android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2843)
      9 frames
    4. Android Platform
      FrameLayout.onMeasure
      1. android.view.View.measure(View.java:18834)
      2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5953)
      3. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
      4. android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
      5. android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
      6. android.view.View.measure(View.java:18834)
      7. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5953)
      8. android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
      8 frames
    5. Android v7
      ContentFrameLayout.onMeasure
      1. android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
      1 frame
    6. Android Platform
      FrameLayout.onMeasure
      1. android.view.View.measure(View.java:18834)
      2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5953)
      3. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
      4. android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
      5. android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
      6. android.view.View.measure(View.java:18834)
      7. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5953)
      8. android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
      9. android.view.View.measure(View.java:18834)
      10. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5953)
      11. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
      12. android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
      13. android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
      14. android.view.View.measure(View.java:18834)
      15. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5953)
      16. android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
      16 frames
    7. Android
      PhoneWindow$DecorView.onMeasure
      1. com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2685)
      1 frame
    8. Android Platform
      ActivityThread.main
      1. android.view.View.measure(View.java:18834)
      2. android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2131)
      3. android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1237)
      4. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1474)
      5. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1125)
      6. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6100)
      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:5525)
      14 frames