What is SugarContext.init(this) in Sugar ORM

4.1k views Asked by At

I am using Sugar ORM to save data locally. But there is something that i don't understand.

What is SugarContext.init(this) and SugarContext.terminate()?

What are these two funtion do? Can anyone explain it?

Thank you.

1

There are 1 answers

2
Philipo On

SugarContext works as a singleton class (only one instance of this class is allowed). - init create a new context or returns the object - terminate, closes the connection to the SQLite "database"