Skip to content

Instantly share code, notes, and snippets.

@amphora001
Last active December 31, 2015 04:19
@Override
public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) {
try {
// Get the auth token for the current account
String authToken = mAccountManager.blockingGetAuthToken(account, AUTHTOKEN_TYPE, true);
ArrayList localTvShows = new ArrayList();
Cursor curTvShows = provider.query(TvShowsContract.CONTENT_URI, null, null, null, null);
if (curTvShows != null) {
while (curTvShows.moveToNext()) {
localTvShows.add(TvShow.fromCursor(curTvShows));
}
curTvShows.close();
}
// TODO See what Remote shows are missing on Local
} catch (Exception e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment