---
title: "How to hide keyboard on outside tap for  edittext, in android."  
description: "How to hide keyboard on outside tap for  edittext, in android."  
author: "Anonymous User"  
published: 2015-02-27  
updated: 2015-02-27  
canonical: https://www.mindstick.com/forum/12987/how-to-hide-keyboard-on-outside-tap-for-edittext-in-android  
category: "android"  
tags: ["android", "android controls"]  
reading_time: 1 minute  

---

# How to hide keyboard on outside tap for  edittext, in android.

How to hide [keyboard](https://www.mindstick.com/forum/23117/android-soft-keyboard-close-hide) on outside [tap](https://answers.mindstick.com/qa/106164/tips-for-winning-in-mlb-tap-sports-baseball-2022) for edittext, in android.?

## Replies

### Reply by Jayden Bell

On your activity you have need to add touch method like this :\

```
      @Override      public boolean onTouchEvent(MotionEvent event) {            // TODO Auto-generated method stub             InputMethodManager inputManager =(InputMethodManager) getApplicationContext()                        .getSystemService(Context.INPUT_METHOD_SERVICE);             inputManager.hideSoftInputFromWindow(MainActivity.this.getCurrentFocus().getWindowToken(),             InputMethodManager.HIDE_NOT_ALWAYS);             return super.onTouchEvent(event);      } 
```


---

Original Source: https://www.mindstick.com/forum/12987/how-to-hide-keyboard-on-outside-tap-for-edittext-in-android

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
