---
title: onSuspend
framework: tvmljs
role: symbol
role_heading: Instance Property
path: tvmljs/app/1627431-onsuspend
---

# onSuspend

A callback function that is automatically called when the app is sent to the background.

## Declaration

```data
attribute function onSuspend;
```

## Discussion

Discussion Use the onSuspend attribute to stop any actions when the app moves from the foreground to the background. This attribute must be set to a function that accepts an options argument; for example App.onSuspend = function (options) {}. The options argument is always set to null.

## See Also

### Responding to App Life Cycle Events

- [onError](tvmljs/app/1627353-onerror.md)
- [onExit](tvmljs/app/1627419-onexit.md)
- [onLaunch](tvmljs/app/1627407-onlaunch.md)
- [onResume](tvmljs/app/1627415-onresume.md)
