java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.Window.setContentView(int)' on a null object reference

Stack Overflow | user3757605 | 5 months ago
  1. 0

    Android setContentView crashes my application

    Stack Overflow | 5 months ago | user3757605
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.Window.setContentView(int)' on a null object reference
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.view.Window.setContentView(int)' on a null object reference

      at android.app.Activity.setContentView()
    2. Android Platform
      Activity.setContentView
      1. android.app.Activity.setContentView(Activity.java:2166)
      1 frame
    3. com.example.name
      GameLoopThread.run
      1. com.example.name.mygame.MainActivity.gameOverUi(MainActivity.java:15)
      2. com.example.name.mygame.GameView.gameOver(GameView.java:16)
      3. com.example.name.mygame.GameView.onDraw(GameView.java:188)
      4. com.example.name.mygame.GameLoopThread.run(GameLoopThread.java:37)
      4 frames