SyncAdapter.java 文件源码

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

项目:OurVLE 作者:
/**
 * Perform a sync for this account. SyncAdapter-specific parameters may
 * be specified in extras, which is guaranteed to not be null. Invocations
 * of this method are guaranteed to be serialized.
 *
 * @param account    the account that should be synced
 * @param extras     SyncAdapter-specific parameters
 * @param authority  the authority of this sync request
 * @param provider   a ContentProviderClient that points to the ContentProvider for this
 *                   authority
 * @param syncResult SyncAdapter-specific parameters
 */
@Override
public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) {
    sharedPrefs = super.getContext().getSharedPreferences(MoodleConstants.PREFS_STRING, Context.MODE_PRIVATE);

    first_update = sharedPrefs.getInt(MoodleConstants.FIRST_UPDATE, 404); // flag to check whether this is the first update

    mSites = new Select().all().from(SiteInfo.class).execute();

    if(mSites==null)
        return;
    if(mSites.size()<=0)
        return;

    token = mSites.get(0).getToken(); // gets the url token

    courses = new Select().all().from(Course.class).execute(); // gets all the courses

    updateLatestEvents();
    updateLatestForumPosts();
    updateLatestDiscussionPots();
   // updateLatestCourseContent();
    updateMembers();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号