java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.deleteDatabase(java.lang.String)' on a null object reference

Stack Overflow | Theo | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Junit test for Sqlite giving null pointer exceptions

    Stack Overflow | 7 months ago | Theo
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.deleteDatabase(java.lang.String)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'boolean android.content.Context.deleteDatabase(java.lang.String)' on a null object reference

      at team.football.ael.DBTesting.deleteTheDatabase()
    2. team.football.ael
      DBTesting.testDropDB
      1. team.football.ael.DBTesting.deleteTheDatabase(DBTesting.java:33)
      2. team.football.ael.DBTesting.testDropDB(DBTesting.java:30)
      2 frames
    3. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames