How to use SQLite from Services in Android?

前端 未结 1 1242
日久生厌
日久生厌 2020-12-10 08:30

It\'s sad how hard it is to find a simple line of code that does this \"In my opinion\".

Anyhow, the problem is I have a program with activities and services \

相关标签:
1条回答
  • 2020-12-10 08:39

    Just do it in the same way you did it for your activity. The only thing that you need to instantiate TheDB is a context; Activity is a Context as well as Service.

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