java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sensei.mist/com.example.sensei.mist.SecondActivity}: 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 | Vortex | 7 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

    App crashes when i switch to another activity that contains recycler view

    Stack Overflow | 7 months ago | Vortex
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sensei.mist/com.example.sensei.mist.SecondActivity}: 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.example.sensei.mist.SecondActivity.onCreate()
    2. com.example.sensei
      SecondActivity.onCreate
      1. com.example.sensei.mist.SecondActivity.onCreate(SecondActivity.java:33)
      1 frame
    3. Android Platform
      ActivityThread.performLaunchActivity
      1. android.app.Activity.performCreate(Activity.java:5990)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
      3 frames