---
title: "Discussion on \"How to handle onBackPressed()\" | Hashnode"
description: "Discussion on \"How to handle onBackPressed()\". Use the isTaskRoot() method in the onCreate method of the SplashActivity of the app (the root Activity of the app) to determine whether it is the root."
url: "https://hashnode.com/posts/how-to-handle-onbackpressed/633b0e2a9ede2248d23b7272"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to handle onBackPressed()](https://mcode.hashnode.dev/how-to-handle-onbackpressed?utm_source=hashnode&utm_medium=feed)

Use the isTaskRoot() method in the onCreate method of the SplashActivity of the app (the root Activity of the app) to determine whether it is the root.

Oct 3, 2022 · 3 min read · mcode.hashnode.dev  
Read the article

-   [#mobile-development](https://hashnode.com/tag/mobile-development)
-   [#android-app-development](https://hashnode.com/tag/android-app-development)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#flutter](https://hashnode.com/tag/flutter)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)

## Written by

[Laxmi kant](https://hashnode.com/@laxmik)

@laxmik · India

  
[View profile](https://hashnode.com/@laxmik)

open source,Programming Blogs,Android Developer Kotlin || flutter

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
