---
title: "键盘显示与隐藏"
author: "bashenmail"
date: "2010-10-15T14:18:51Z"
tags: []
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2010-10-15T14:18:51Z"
id: 785732
url: "https://bashenmail.iteye.com/blog/785732"
---

```
InputMethodManager imm = (InputMethodManager)getSystemService(SendActivity.this.INPUT_METHOD_SERVICE);


//显示键盘
imm.showSoftInput(editText, 0);

//隐藏键盘
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
```