Skip to main content
The ClickTerm Android SDK uses listener callbacks to communicate results. The show() and showAcceptedContent() methods accept listener interfaces that fire on success or error.

Show result

When ClicktermDialog.show() completes:
ClicktermDialog.show(this, request, null,
    new ClicktermDialog.OnAgreementResultListener() {
        @Override
        public void onSuccess(String clicktermSignature) {
            if (clicktermSignature != null) {
                // User accepted or declined — send Signature to your backend
                sendToBackend(clicktermSignature);
            } else {
                // User already accepted the latest major version — no dialog was shown
                Log.i("Clickterm", "Already accepted.");
            }
        }

        @Override
        public void onError(String message) {
            // SDK or network error
            Log.e("Clickterm", message);
        }
    }
);

Possible outcomes

OutcomeCallbackclicktermSignature value
User acceptsonSuccessNon-null Signature string — send it to your backend
User declinesonSuccessNon-null Signature string — verify it to record the decline
User already acceptedonSuccessnull — no dialog was shown, no action needed
ErroronErrorN/A — message contains the error description
A null Signature in onSuccess means the user has already accepted the latest major version. No action is needed on your part.

Error handling

Errors are delivered via the onError callback:
@Override
public void onError(String message) {
    switch (message) {
        case "SDK not initialized":
            Log.e("Clickterm", "Call ClicktermClient.initialize() first");
            break;
        default:
            Log.e("Clickterm", "Clickwrap error: " + message);
            break;
    }
}
Common error scenarios:
ErrorCause
SDK not initializedClicktermClient.initialize() was not called
Template not foundTemplate is disabled or has no effective version
Network errorCannot reach the ClickTerm API

Show accepted content result

The showAcceptedContent() method uses a separate listener:
ClicktermDialog.showAcceptedContent(this, request,
    new ClicktermDialog.OnAcceptedContentListener() {
        @Override
        public void onSuccess(ClickwrapTemplateContent content) {
            // content.getContent() returns the accepted agreement text
            Log.i("Clickterm", content.getContent());
        }

        @Override
        public void onError(String message) {
            Log.e("Clickterm", message);
        }
    }
);
showAcceptedContent only works if the end user has an accepted and verified event for the given template.