1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-29 11:10:35 +02:00

Hold on to OpenScale instance in the Application instance

Hopefully fixes #294.
This commit is contained in:
Erik Johansson
2018-06-24 21:42:56 +02:00
parent 6be45a3ebf
commit c790ee611d

View File

@@ -21,6 +21,7 @@ import com.health.openscale.BuildConfig;
import timber.log.Timber;
public class Application extends android.app.Application {
OpenScale openScale;
private class TimberLogAdapter extends Timber.DebugTree {
@Override
@@ -40,5 +41,8 @@ public class Application extends android.app.Application {
// Create OpenScale instance
OpenScale.createInstance(getApplicationContext());
// Hold on to the instance for as long as the application exists
openScale = OpenScale.getInstance();
}
}