private void initializeFavoriteCheck() {
        final IConnector connector = ConnectorFactory.getConnector(cache);

        if ((connector instanceof IFavoriteCapability) && ((IFavoriteCapability) connector).supportsAddToFavorite(cache, logType.get()) && loggingManager.supportsLogWithFavorite()) {
            final int remainingPoints = availableFavoritePoints + (cache.isFavorite() ? 1 : 0);
            binding.favoriteCheck.setText(res.getQuantityString(loggingManager.getFavoriteCheckboxText(), remainingPoints, remainingPoints));
            if (availableFavoritePoints > 0 || (this.logEditMode == LogEditMode.EDIT_EXISTING && cache.isFavorite())) {
                binding.favoriteCheck.setVisibility(availableFavoritePoints > 0 ? View.VISIBLE : View.GONE);
                binding.favoriteCheck.setChecked(cache.isFavorite());
            }
        } else {
            binding.favoriteCheck.setVisibility(View.GONE);
        }
    }
Checks whether there are favorite points available and sets the corresponding visibility of
"add to favorite" checkbox.
main/src/main/java/cgeo/geocaching/log/LogCacheActivity.java