> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clickterm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ClicktermDialog

> API reference for the ClicktermDialog in the Android SDK — showing clickwrap dialogs and accepted content.

`ClicktermDialog` controls the clickwrap consent dialog shown to end users in your Android app.

## Methods

### show

Displays a clickwrap dialog. If the user has already accepted the latest effective major version, the `onSuccess` callback fires with a `null` Signature.

```java theme={null}
ClicktermDialog.show(
    Activity activity,
    ClickwrapTemplate request,
    JSONObject configOptions,  // nullable
    ClicktermDialog.OnAgreementResultListener listener
);
```

**Parameters:**

| Parameter       | Type                        | Description                                                          |
| --------------- | --------------------------- | -------------------------------------------------------------------- |
| `activity`      | `Activity`                  | The current Android Activity                                         |
| `request`       | `ClickwrapTemplate`         | Request object with template ID, user ID, placeholders, and language |
| `configOptions` | `JSONObject`                | Optional configuration (pass `null` for defaults)                    |
| `listener`      | `OnAgreementResultListener` | Callback for success/error                                           |

**ClickwrapTemplate constructor:**

```java theme={null}
new ClickwrapTemplate(
    String clickwrapTemplateId,
    String endUserId,
    TemplatePlaceholdersRequestDto templatePlaceholders,
    String languageCode
);
```

| Parameter              | Type                             | Required | Description                                                                                              |
| ---------------------- | -------------------------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `clickwrapTemplateId`  | `String`                         | Yes      | Template ID from the dashboard                                                                           |
| `endUserId`            | `String`                         | Yes      | Your identifier for the end user (max 256 chars)                                                         |
| `templatePlaceholders` | `TemplatePlaceholdersRequestDto` | No       | Structured [placeholder](/dev/guides/placeholders) object with standard fields plus `customPlaceholders` |
| `languageCode`         | `String`                         | No       | Language code (e.g., `"en"`)                                                                             |

**Example:**

```kotlin theme={null}
val placeholders = TemplatePlaceholdersRequestDto(
    fullName = "Alice Example",
    email = "alice@example.com",
    company = "Acme Corp",
    customPlaceholders = mapOf(
        "region" to "EMEA",
    ),
)

val request = ClickwrapTemplate(
    "YOUR_TEMPLATE_ID", endUserId, placeholders, "en"
)

ClicktermDialog.show(this, request, null,
    object : ClicktermDialog.OnAgreementResultListener {
        override fun onSuccess(clicktermSignature: String?) {
            if (clicktermSignature == null) {
                Log.i("Clickterm", "User already accepted.")
            } else {
                // Send Signature to your backend for verification
                Log.i("Clickterm", clicktermSignature)
            }
        }

        override fun onError(message: String) {
            Log.e("Clickterm", message)
        }
    }
)
```

***

### showAcceptedContent

Displays the previously accepted clickwrap content.

```java theme={null}
ClicktermDialog.showAcceptedContent(
    Activity activity,
    ClickwrapAcceptedAgreementRequest request,
    ClicktermDialog.OnAcceptedContentListener listener
);
```

**Example:**

```java theme={null}
ClickwrapAcceptedAgreementRequest request =
    new ClickwrapAcceptedAgreementRequest(templateId, endUserId, "en");

ClicktermDialog.showAcceptedContent(this, request,
    new ClicktermDialog.OnAcceptedContentListener() {
        @Override
        public void onSuccess(ClickwrapTemplateContent content) {
            Log.i("Clickterm", content.getContent());
        }

        @Override
        public void onError(String message) {
            Log.e("Clickterm", message);
        }
    }
);
```

<Note>
  Only works if the user has an accepted and verified event for this template.
</Note>
