mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-29 19:20:36 +02:00
Hold on to OpenScale instance in the Application instance
Hopefully fixes #294.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user