Skip to content

Instantly share code, notes, and snippets.

@kmdupr33
Created April 24, 2015 11:05
Show Gist options
  • Save kmdupr33/84a4a4c92affc3910536 to your computer and use it in GitHub Desktop.
Save kmdupr33/84a4a4c92affc3910536 to your computer and use it in GitHub Desktop.
@Override
public void onStop() {
super.onStop();
if (mInitStarred != mStarred) {
if (UIUtils.getCurrentTime(this) < mSessionStart) {
// Update Calendar event through the Calendar API on Android 4.0 or new versions.
Intent intent = null;
if (mStarred) {
// Service launcher sets up intent to add session to Calendar
mServiceLauncher.launchSessionCalendarService(SessionCalendarService.ACTION_ADD_SESSION_CALENDAR, mSessionUri,
mSessionStart, mSessionEnd, mRoomName, mTitleString);
} else {
// Set up intent to remove session from Calendar, if exists.
mServiceLauncher.launchSessionCalendarService(SessionCalendarService.ACTION_REMOVE_SESSION_CALENDAR, mSessionUri,
mSessionStart, mSessionEnd, mTitleString);
}
if (mStarred) {
setupNotification();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment