Last active
August 29, 2015 14:05
-
-
Save CanOrhan/43ddd0f60c4a33fcdb4e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 RegistrationBackstackChangeListener implements FragmentManager.OnBackStackChangedListener { | |
private final Activity mActivity; | |
public RegistrationBackstackChangeListener(Activity activity){ | |
mActivity = activity; | |
} | |
@Override | |
public void onBackStackChanged() { | |
} | |
} |
This file contains hidden or 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
@Module( | |
injects = { | |
RegistrationActivity.class, | |
ApiKeyFragment.class | |
} | |
) | |
public class RegistrationModule { | |
private final Activity mActivity; | |
public RegistrationModule(Activity activity){ | |
mActivity = activity; | |
} | |
@Provides public FragmentManager.OnBackStackChangedListener provideBackstackChangeListener(){ | |
return new RegistrationBackstackChangeListener(mActivity); | |
} | |
} |
This file contains hidden or 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 SomeActivity extends Activity implements ApiKeyFragment.OnFragmentInteractionListener{ | |
@Inject FragmentManager.OnBackStackChangedListener mStackChangeListener; | |
private ObjectGraph mObjectGraph; | |
@Override | |
public void onAttachedToWindow() { | |
super.onAttachedToWindow(); | |
} | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_registration); | |
EveSlotsApp app = (EveSlotsApp) getApplication(); | |
mObjectGraph = app.getObjectGraph().plus(new RegistrationModule(this)); | |
mObjectGraph.inject(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment