Skip to content

Instantly share code, notes, and snippets.

@kmdupr33
Last active August 29, 2015 14:20
Show Gist options
  • Save kmdupr33/5e06819aec1694453ff3 to your computer and use it in GitHub Desktop.
Save kmdupr33/5e06819aec1694453ff3 to your computer and use it in GitHub Desktop.
Showing injected dependencies and onStop()
public class SessionDetailViewPresenter implements RepositoryManagerCallbacks {
public SessionDetailViewPresenter(SessionDetailView sessionDetailView,
RepositoryManager loaderManager,
ServiceStarter serviceStarter,
long calendarId
) {
mSessionDetailView = sessionDetailView;
mLoaderManager = loaderManager;
mServiceStarter = serviceStarter;
mCalendarId = calendarId;
}
//...
public void onViewTranslatorStopped() {
if (mInitStarred != mStarred) {
if (System.currentTimeMillis() < mSessionStart) {
CalendarSession calendarSession = new CalendarSession(mSessionUri, mSessionStart, mSessionEnd, mTitleString, mRoomName);
if (mStarred) {
mServiceStarter.startAddCalendarSessionService(mCalendarId, calendarSession);
} else {
mServiceStarter.startRemoveCalendarSessionService(mCalendarId, calendarSession);
}
}
if (mStarred) {
setupSessionNotification();
}
}
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment