I opted to manage H2 from a service. All my activities bind themselves to this service in activity.onResume(), unbind themselves in onPause(). When no activity have been bound to the service for 5 seconds, the service stop itself, stop h2 and do some other cleanup.
So when my app goes in the background without beeing destroyed, h2 is stopped after 5 seconds. If the user restore my app in the foreground, h2 is resumed (i restart the service if needed). My app has been published, and It seems to be working fine. But I still think i may have missed a simpler solution. It would be nice if h2 had an official recipe for android. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
