I need to have access to the assistant not only from Activity, but, for example, from BroadcastReceivers and AsyncTasks. Is it correct that if I use OrmLiteBaseActivity for the approach, then use the following methods:
OpenHelperManager.getHelper(context, DatabaseHelper.class); OpenHelperManager.releaseHelper();
inside not activity classes?
EDIT:
I understand that the helper life cycle is handled by OrmLiteBaseActivity . I ask how to handle the assistant's life cycle outside of the activity. For example, I need access to a database from BroadcastReceiver or AsyncTask . This is the right way to achieve this using OpenHelperManager.getHelper(context, DatabaseHelper.class); when I run the database stuff in another thread and OpenHelperManager.releaseHelper(); when I did all the work with the database and want to free the assistant?
source share