java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Android Snake Game (How to add audio)?
    via Stack Overflow by scsims
    ,
  • add sound to android (not main class)
    via Stack Overflow by Jeremy
    ,
    • java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference at com.example.android.snake.SnakeView.updateSnake(SnakeView.java:501) at com.example.android.snake.SnakeView.update(SnakeView.java:427) at com.example.android.snake.SnakeView$RefreshHandler.handleMessage(SnakeView.java:131) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    No Bugmate found.