# onBackButton

## Description

Triggers the back button to navigate to another page. This is applicable to android devices only.

## Input / Parameter

N/A

## Output

N/A

## Callback

### callback

The function to be executed when the back button is triggered to navigate to the page specified successfully.

## Video

Coming Soon.

## Example

The user wants to redirect to another page when they press the back button.

### Steps

| No. | Description                      |                                                                                                                                                 |
| --- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| 1.  | ![](/files/dQqkoHIyqu5EdoufMd9P) | Drag a button to a page in the mobile designer. Select the event `click` for the button and drag the `onBackButton` function to the event flow. |
| 2.  | ![](/files/M31beucXomiaUMSQfgzq) | Drag the function to be executed when the back button is triggered. In this example, we are using the `gotoPage` function.                      |
| 3.  | ![](/files/yO93mKiiMZV5XyBc8QUj) | Select the page to navigate to.                                                                                                                 |

### Result

When the back button is pressed, the current page will redirect to pgWelcome.

## Links


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/device/onbackbutton.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
