openorcreatedatabase gives nullpointerexception

后端 未结 2 689
甜味超标
甜味超标 2021-01-27 20:59

i used databases before in the android app i am working on so usualy i open() the database when my query is finished i close() it again

with my latest change to my data

相关标签:
2条回答
  • 2021-01-27 21:38

    I just solved my problem!! (happy modus)

    i had called the function gegevensupdaten() from my 3th class AWebServerAdapter

    there seems to be something wrong with the context of that class to be able to do databaseactions with my 2nd(Abezoeadapter) class

    so i returned the data from webserver to my main(1st,bezoekrapporten) class and called gegevensupdaten() from my 1st class

    why this context of 3th class doesn't work is still a mystery for me

    0 讨论(0)
  • 2021-01-27 21:48

    The stacktrace says the Context you passed to SQLiteOpenHelper was null.

    The code doesn't show how you initialize your ABezoeAdapter where the Context comes from but that's where you should be looking to solve the problem.

    0 讨论(0)
提交回复
热议问题