Last active
August 29, 2015 14:19
-
-
Save jrobinson3k1/d9417c24b1489552792e 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 SessionsManager { | |
private Context mContext; | |
@Inject | |
SessionsManager(Context context) { | |
mContext = context; | |
} | |
public boolean isInMySchedule() { | |
Cursor cursor = mContext.getContentResolver().query(/* ... */); | |
try { | |
return cursor.getInt(SessionsQuery.IN_MY_SCHEDULE) != 0; | |
} finally { | |
cursor.close(); | |
} | |
} | |
public void addSessionCalendar(Uri sessionUri, long start, long end, String room, String title) { | |
intent = new Intent(SessionCalendarService.ACTION_ADD_SESSION_CALENDAR, sessionUri); | |
intent.putExtra(SessionCalendarService.EXTRA_SESSION_START, start); | |
intent.putExtra(SessionCalendarService.EXTRA_SESSION_END, end); | |
intent.putExtra(SessionCalendarService.EXTRA_SESSION_ROOM, room); | |
intent.putExtra(SessionCalendarService.EXTRA_SESSION_TITLE, title); | |
mContext.startService(intent); | |
} | |
public void removeSessionCalendar(Uri sessionUri, long start, long end, String room, String title) { | |
intent = new Intent(SessionCalendarService.ACTION_REMOVE_SESSION_CALENDAR, sessionUri); | |
intent.putExtra(SessionCalendarService.EXTRA_SESSION_START, start); | |
intent.putExtra(SessionCalendarService.EXTRA_SESSION_END, end); | |
intent.putExtra(SessionCalendarService.EXTRA_SESSION_TITLE, title); | |
mContext.startService(intent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment