VersionManager.java 761 Bytes
package com.lotus.town.version;

import android.content.Context;

import com.lotus.town.utils.SharedPrefConfig;
import com.sdk.utils.VerstionUtils;

public class VersionManager {

    public static boolean checkVersion(Context context){
        if(SharedPrefConfig.getInstance(context).getCurrentVersionCode() < VerstionUtils.getLocalVersion(context)){
            SharedPrefConfig.getInstance(context).setLastVersion(SharedPrefConfig.getInstance(context).getCurrentVersionCode(),SharedPrefConfig.getInstance(context).getCurrentVersionName());
            SharedPrefConfig.getInstance(context).setCurrentVersion(VerstionUtils.getLocalVersion(context),VerstionUtils.getLocalVersionName(context));
            return true;
        }
        return false;
    }
}