Last active
June 7, 2016 07:36
-
-
Save mreichelt/35d4e3afd8744aa75e8ecb84418c3f90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestApp extends OurApp { | |
/** overrides method in OurApp that initializes our actual Dagger2 component */ | |
@Override | |
protected void createComponents() { | |
OurTestComponent component = mock(OurTestComponent.class); | |
// required so our App init call works properly, which registers these callbacks | |
// WOAH, this is responsible for the memory leak!! But why? | |
when(component.activityLifecycleCallbacks()) | |
.thenReturn(mock(activityLifecycleCallbacks)); | |
OurApp.setComponent(component); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment