直接前往內容

最常造訪的網頁

最近瀏覽的網頁

navigation

Handling Keyboard Input

Dependencies and prerequisites

  • Android 1.6 (API Level 3) or higher

The Android system shows an on-screen keyboard—known as a soft input method—when a text field in your UI receives focus. To provide the best user experience, you can specify characteristics about the type of input you expect (such as whether it's a phone number or email address) and how the input method should behave (such as whether it performs auto-correct for spelling mistakes).

In addition to the on-screen input methods, Android also supports hardware keyboards, so it's important that your app optimize its user experience for interaction that might occur through an attached keyboard.

These topics and more are discussed in the following lessons.

Lessons

Specifying the Input Method Type
Learn how to show certain soft input methods, such as those designed for phone numbers, web addresses, or other formats. Also learn how to specify characteristics such as spelling suggestion behavior and action buttons such as Done or Next.
Handling Input Method Visibility
Learn how to specify when to show the soft input method and how your layout should adjust to the reduced screen space.
Supporting Keyboard Navigation
Learn how to verify that users can navigate your app using a keyboard and how to make any necessary changes to the navigation order.
Handling Keyboard Actions
Learn how to respond directly to keyboard input for user actions.
本網站使用 Cookie 儲存你在此指定的語言和顯示選項偏好設定。

掌握有關 Android 開發人員的最新消息和實用訣竅,協助你製作最受歡迎的 Google Play 內容。

* 必填欄位

訂閱成功!

在 WeChat 上追蹤 Google Developers

你要以瀏覽這個網站嗎?

你要求以顯示這個網頁,但你為此網站指定的語言偏好設定為

是否要變更語言偏好設定並改用瀏覽網站?稍後如要變更語言偏好設定,請利用位在每個網頁最下方的語言選單來調整設定。

你的 API 層級必須達 以上才能存取這個級別

本說明文件已隱藏,因為你為該文件選取的 API 層級為 。使用左側導覽列上方的選取工具即可變更說明文件的 API 層級。

如需進一步瞭解如何為應用程式指定 API 層級的相關資訊,請參閱 Supporting Different Platform Versions (支援不同的平台版本) (英文)。

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)