NullPointerException on getReadableDatabase()

前端 未结 5 1136
自闭症患者
自闭症患者 2021-01-17 04:49

I have this method in a class (non-activity) -

public boolean usernameChk(String usrname) {

    String usrnmQuery = \"SELECT * FROM \" + TABLE_ACCOUNTS + \"         


        
5条回答
  •  没有蜡笔的小新
    2021-01-17 05:10

    I was getting the same error since 3 days. But it is solved now. I created a new object of the database whenever i want to connect to the database. If i have 10 functions in database, i will call them with 10 different objects hence not giving me the error

提交回复
热议问题