Questions tagged [android-softkeyboard]

The default onscreen input method provided by Android OS.

Android Soft Keyboard is the onscreen keyboard provided by Android OS.

Key Events of Android soft keyboard

On-screen Input Methods in Android Developers blog

2751 questions
4316
votes
128 answers

How to close/hide the Android soft keyboard programmatically?

I have an EditText and a Button in my layout. After writing in the edit field and clicking on the Button, I want to hide the virtual keyboard when touching outside the keyboard. I assume that this is a simple piece of code, but where can I find an…
558
votes
45 answers

How to check visibility of software keyboard in Android?

I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android?
fhucho
  • 34,062
  • 40
  • 136
  • 186
542
votes
48 answers

How to show soft-keyboard when edittext is focused

I want to automatically show the soft-keyboard when an EditText is focused (if the device does not have a physical keyboard) and I have two problems: When my Activity is displayed, my EditText is focused but the keyboard is not displayed, I need to…
Ludovic Landry
  • 11,606
  • 10
  • 48
  • 80
429
votes
6 answers

Android: how to make keyboard enter button say "Search" and handle its click?

I can't figure this out. Some apps have an EditText (textbox) with the help of which, when you touch it and it brings up the on-screen keyboard, the keyboard has a "Search" button instead of an enter key. I want to implement this. How can I…
Ricket
  • 33,368
  • 30
  • 112
  • 143
423
votes
49 answers

How to hide soft keyboard on android after clicking outside EditText?

Ok everyone knows that to hide a keyboard you need to implement: InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); But the big deal here is how…
htafoya
  • 18,261
  • 11
  • 80
  • 104
326
votes
37 answers

How do I detect if software keyboard is visible on Android Device or not?

Is there a way in Android to detect if the software (a.k.a. "soft") keyboard is visible on screen?
andreea
  • 3,425
  • 2
  • 18
  • 10
267
votes
11 answers

Disabling the fullscreen editing view for soft keyboard input in landscape?

On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it). I assume this can be…
jnic
  • 8,695
  • 3
  • 33
  • 47
256
votes
21 answers

How to capture the "virtual keyboard show/hide" event in Android?

I would like to alter the layout based on whether the virtual keyboard is shown or not. I've searched the API and various blogs but can't seem to find anything useful. Is it possible? Thanks!
Sander Versluys
  • 72,737
  • 23
  • 84
  • 91
204
votes
18 answers

How to adjust layout when soft keyboard appears

I would like to adjust/re-size the layout when the soft-keyboard activated, as below: Before and After: Found couple resources in SO: How to keep all fields and texts visible while the soft keyboard is shown android soft keyboard spoils layout…
Roy Lee
  • 10,572
  • 13
  • 60
  • 84
197
votes
29 answers

Android How to adjust layout in Full Screen Mode when softkeyboard is visible

I have researched a lot to adjust the layout when softkeyboard is active and I have successfully implemented it but the problem comes when I use android:theme="@android:style/Theme.NoTitleBar.Fullscreen" this in my activity tag in manifest file. For…
Vineet Shukla
  • 23,865
  • 10
  • 55
  • 63
195
votes
11 answers

Disable soft keyboard on NumberPicker

I'm trying to deactivate the soft keyboard when using a NumberPicker to enter numerical values (for aesthetic reasons). This is my layout-xml-code:
183
votes
6 answers

Difference between adjustResize and adjustPan in android?

I tried to write a code which is used to re-size the UI components when soft-keyboard appears. When I use adjustResize, it res-size the UI components and at the same time adjustPan gave me same output. I want to know the difference between them…
androidcodehunter
  • 21,567
  • 19
  • 47
  • 70
171
votes
31 answers

Soft keyboard open and close listener in an activity in Android

I have an Activity where there are 5 EditTexts. When the user clicks on the first EditText, the soft keyboard opens to enter some value in it. I want to set some other View's visibility to Gone when the soft keyboard opens and also when the user…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
162
votes
23 answers

How to hide Soft Keyboard when activity starts

I have an Edittext with android:windowSoftInputMode="stateVisible" in Manifest. Now the keyboard will be shown when I start the activity. How to hide it? I cannot use android:windowSoftInputMode="stateHidden because when keyboard is visible then…
Aju
  • 4,597
  • 7
  • 35
  • 58
148
votes
13 answers

Android Use Done button on Keyboard to click button

Ok in my app I have a field for the user to input a number. I have the field set to only accept numbers. When the user clicks on the field it brings up the keyboard. On the keyboard (on ICS) there is a done button. I would like for the done button…
mpeerman
  • 2,050
  • 2
  • 16
  • 16
1
2 3
99 100