---
title: "How to disabled back button in android"  
description: "How to disabled back button in android"  
author: "Anonymous User"  
published: 2015-02-13  
updated: 2015-02-13  
canonical: https://www.mindstick.com/forum/12958/how-to-disabled-back-button-in-android  
category: "android"  
tags: ["android"]  
reading_time: 1 minute  

---

# How to disabled back button in android

How to disabled back [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) in [android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios)?

## Replies

### Reply by Anonymous User

Basically android back button has override method or event. You can handle back button action according to your need on this event; Paste the following code in your Activity and Now your back button is disabled.

```
@Override    public boolean onKeyDown(int keyCode, KeyEvent event) {         if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {             if (keyCode == KeyEvent.KEYCODE_BACK) {              }          }// return super.OnKeyDown(KeyCode,event);// This code will stop your back button work         return false;    }
```


---

Original Source: https://www.mindstick.com/forum/12958/how-to-disabled-back-button-in-android

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
