1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-30 19:49:59 +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; import timber.log.Timber;
public class Application extends android.app.Application { public class Application extends android.app.Application {
OpenScale openScale;
private class TimberLogAdapter extends Timber.DebugTree { private class TimberLogAdapter extends Timber.DebugTree {
@Override @Override
@@ -40,5 +41,8 @@ public class Application extends android.app.Application {
// Create OpenScale instance // Create OpenScale instance
OpenScale.createInstance(getApplicationContext()); OpenScale.createInstance(getApplicationContext());
// Hold on to the instance for as long as the application exists
openScale = OpenScale.getInstance();
} }
} }