---
title: "Android SDK: Custom actions"
description: "Handle custom actions triggered by the widget with the Gleap Android SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/478-android-sdk-custom-actions
collection: "Android"
updated: 2026-11-01
language: en
---

# Android SDK: Custom actions

Handle custom actions triggered by the widget with the Gleap Android SDK. Follow the integration code examples.

We know that the built in actions (Bug Reporting, Feature Requests, Ratings & Contact Us) might not be enough for certain use cases. For these situations we offer custom actions, which allow you to start any custom action by code.

## Configure a custom action

Open Settings → Widget → Content → Quick actions. Add or open a quick action, choose Custom action, and enter its Custom action name. Use that exact name in the handler below.

Now you need to **set a name for your custom action**. Choose any name you like (it's however important that this name matches the name you check in the next step).

![Current messenger quick-action settings in the Pied Piper demo project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/gmAdnE7X2jnNhNn1dRmzvgLczFyPAIF7Qsn2PicWuQHx4eAMN1Er2Il0dBP2VBl1brGt4Zn56QT.png)

## Custom action callback

Once you set a custom action in the Gleap dashboard, it will be called automatically on selection through the user. In order to perform custom code, simply implement our `CustomActionCallback` to receive the custom action events.

### Add & implement the Gleap delegate

The following code sample shows how to implement the `CustomActionCallback` protocol.

```java
Gleap.getInstance().registerCustomAction(new CustomActionCallback() {
    @Override
    public void invoke(String customAction, String shareToken) {
        // For custom actions triggered within tickets, shareToken will be set to identify the ticket.
        if (customAction == "MAGIC_ACTION") {
            System.out.println("Magic action got called.");
        }
    }
});
```

> **Info:** The **custom action name** is defined by you in the visual widget configurator on the Gleap dashboard.

## Related

- [Android SDK setup](https://docs.gleap.ai/en/articles/466-android-sdk-setup.md)
- [Android SDK: User identity](https://docs.gleap.ai/en/articles/467-android-sdk-user-identity.md)
- [Android SDK: Callbacks](https://docs.gleap.ai/en/articles/468-android-sdk-callbacks.md)
- [Android SDK: Frontend tools](https://docs.gleap.ai/en/articles/469-android-sdk-frontend-tools.md)
- [Android SDK: Forms](https://docs.gleap.ai/en/articles/470-android-sdk-forms.md)
