Untitled

mail@pastecode.io avatarunknown
plain_text
16 days ago
547 B
1
Indexable
Never
private boolean canDoCheckVersionInvalid() {
        SharedPreferences preferences =
                Preferences.get(mPresenter.getContext(), PREFS_CHECK_VERSION);
        int maxCount = 1; //3
        int count = preferences.getInt(PREFS_KEY_COUNT, maxCount);
        boolean can = false;

        if (count == maxCount) {
            can = true;
            count = 0;
        } else {
            count++;
        }

        preferences.edit()
                .putInt(PREFS_KEY_COUNT, count)
                .apply();

        return can;
    }