louiscad
06/12/2017, 7:36 AMclass Foo {
private Foo mShared;
private Context context;
public Foo sharedInstance(Context context) {
if (mShared == null) {
mShared == new Foo(context)
}
return mShared;
}
}
1 reply
jasonlow: I made a small library to access the Application Context anywhere in Kotlin: https://github.com/LouisCAD/Splitties#app-context