---
page_title: Life Cycle Events
product: UPI TPAP SDK
platform: Flutter
page_source: https://juspay.io/in/docs/upi-tpap-sdk/flutter/interaction-with-sdk/life-cycle-events
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/upi-tpap-sdk/llms.txt
---


## Life Cycle Events



UPI In-app SDK runs in a fragment. Hence, to handle certain events based upon activity life cycle, client will need to forward those events to the SDK.

These events are crucial for seamless functioning of features like OTP reading, App Switches (UPI Intent), Hardware backpress.

Following are the Life cycle events which SDK needs


###   onBackPressed


In order to handle hardware backpress done by user, you have to call `onBackPressed()` on HyperServices Instance in the onBackPressed function of your Checkout Activity.

onBackPressed function returns a boolean. When this return value is true hardware backpressed is consumed by Juspay SDK, if its false you need to handle backpress



#### Code Snippets: -

#### Flutter Code Snippet:

```flutter
{"success":false,"message":"Failed to fetch snippet"}
```


---

## Complete Code Reference

The following code files are referenced in the steps above:

### home.dart

```
{"success":false,"message":"Failed to fetch snippet"}
```


---

## See Also

- [Handle SDK Response](https://juspay.io/in/docs/upi-tpap-sdk/flutter/interaction-with-sdk/handle-sdk-response)
- [Intent Handling](https://juspay.io/in/docs/upi-tpap-sdk/flutter/interaction-with-sdk/intent-handling)
