---
title: "Why does my app terminate when the button is clicked on Android Studio?"  
description: "Why does my app terminate when the button is clicked on Android Studio?"  
author: "Lily Chitlangiya"  
published: 2021-12-28  
canonical: https://answers.mindstick.com/qa/94813/why-does-my-app-terminate-when-the-button-is-clicked-on-android-studio  
category: "troubleshooting"  
tags: ["android studio", "android", "troubleshooting"]  
reading_time: 1 minute  

---

# Why does my app terminate when the button is clicked on Android Studio?

Why does my app terminate when the [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) is clicked on [Android Studio](https://www.mindstick.com/blog/10942/android-studio-vs-eclipse)?

## Answers

### Answer by Hitesh Vohra

- In many different [Android](https://www.mindstick.com/articles/1672/android-internals) apps, the **'Back' button** is used in a variety of ways. Some app developers use it to close their apps, while others use it to return to the prior action of the app.
- To correctly **close an app,** many apps require the user to touch the 'Back' button two times within a short period of time, which is considered best practise.
- As a result, exiting an app with a double-click of the back button is a good idea. Occasionally, a person may inadvertently hit the back button. As a result, we create this functionality to confirm that the user truly wishes to exit the programme.

\

**Read More: S[hould I upgrade to Apple iOS 13.3.1?](https://answers.mindstick.com/qa/94857/should-i-upgrade-to-apple-ios-13-3-1)**


---

Original Source: https://answers.mindstick.com/qa/94813/why-does-my-app-terminate-when-the-button-is-clicked-on-android-studio

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
