TimetableSyncAdapter.java 文件源码

java
阅读 41 收藏 0 点赞 0 评论 0

项目:android-wg-planer 作者:
@Override
public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) {
    Lesson[] oldLessons = TimetableContentHelper.getTimetable(getContext());
    Lesson[] lessons = new SyncServerInterface(getContext()).getTimetable();

    lessons = ClassesUtils.filterLessons(getContext(), lessons);

    if (lessons.length != oldLessons.length || !Utils.containsAll(lessons, oldLessons)) {
        TimetableNotification.notify(getContext());
    }

    TimetableContentHelper.clearTimetable(getContext());

    if (lessons.length > 0) {
        TimetableContentHelper.addLessons(getContext(), lessons);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号