Xamarin.Forms - Akavache how to recreate Sqlite3 connection after BlobCache.Shutdown()

213 views Asked by At

I want the user to be able to leave the App and to come back as many times as he wants. Saving its data in the cache each time the app is sent background.

When my App on Xamarin.Forms goes "OnSleep()" the following code is performed:

BlobCache.LocalMachine.Flush().Wait();
await BlobCache.LocalMachine.InsertObject("test",value);
BlobCache.Shutdown().Wait();

The first time, it works. But when the app is called to the front and then is resent to background, then it failed.

I notice, "BlobCache.Shutdown().Wait();" kills the BlobCache.LocalMachine's connection to Sqlite3. And when the App is back to the front, this connection is not recreated.

Do you know, how to recreate this connection ? Best regards

0

There are 0 answers