private static void vote(@NonNull final Geocache cache, final float rating, @Nullable final Runnable afterVoteSent) {
        AndroidRxUtils.andThenOnUi(AndroidRxUtils.networkScheduler, () -> {
            try {
                final IConnector connector = ConnectorFactory.getConnector(cache);
                if (connector instanceof IVotingCapability && ((IVotingCapability) connector).isValidRating(rating) && ((IVotingCapability) connector).supportsVoting(cache)) {
                    // send over network
                    if (((IVotingCapability) connector).postVote(cache, rating)) {
                        // store locally
                        cache.setMyVote(rating);
                        DataStore.saveChangedCache(cache);
                        return true;
                    }
                    Log.w("VoteDialog.vote: could not send vote");
                }
            } catch (final RuntimeException e) {
                Log.e("VoteDialog.vote: could not send vote", e);
            }

            return false;
        }, status -> {
            ViewUtils.showShortToast(null, LocalizationUtils.getString(status ? R.string.vote_sent : R.string.err_vote_send_rating));
            if (afterVoteSent != null) {
                afterVoteSent.run();
            }
        });
    }
Small dialog showing only a rating bar to vote for the cache. Confirming the dialog will send the vote over the
network (in the background).
main/src/main/java/cgeo/geocaching/gcvote/VoteDialog.java