Questions tagged [android-keypad]

Android supports a variety of keyboard devices including special function keypads (volume and power controls), compact embedded QWERTY keyboards, and fully featured PC-style external keyboards.

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

Useful links

451 questions
288
votes
18 answers

Prevent the keyboard from displaying on activity start

I have an activity with an Edit Text input. When the activity is initialized, the Android keyboard is shown. How can the keyboard remain hidden until the user focuses the input?
Fcoder
  • 9,066
  • 17
  • 63
  • 100
179
votes
24 answers

Move layouts up when soft keyboard is shown?

I have a few elements in a RelativeView with the align bottom attribute set, when the soft keyboard comes up the elements are hidden by the soft keyboard. I would like them to move up so that if there is enough screen space they are shown above the…
Dinedal
  • 2,646
  • 2
  • 19
  • 18
150
votes
31 answers

How to disable copy/paste from/to EditText

In my application, there is a registration screen, where i do not want the user to be able to copy/paste text into the EditText field. I have set an onLongClickListener on each EditText so that the context menu showing copy/paste/inputmethod and…
rDroid
  • 4,875
  • 3
  • 25
  • 30
110
votes
10 answers
91
votes
1 answer

Get Cursor Position in Android in Edit Text?

I am using a custom EditText View. I have overridden the OnKeyUp event and am able to capture the Enter Key press. Now my requirement is, when the user has entered a text "Hi. How are you?" and then keeps the cursor after the word "are" and press…
Vinod
  • 31,933
  • 35
  • 96
  • 119
88
votes
19 answers

EditText with number keypad by default, but allowing alphabetic characters

I have an EditText box and I want the default keyboard that comes up when it is selected to be the numeric keypad, since most of the time users will be entering numbers. However, I do want to allow users to enter alphabetic characters too, if they…
Frank Bozzo
  • 889
  • 1
  • 6
  • 3
64
votes
11 answers

Android Keyboard hides EditText

When I try to write something in an EditText which is at the bottom of the screen, the soft keyboard hides the EditText. How can I resolve this issue? Below is my xml code. I'm using this in a Fragment.
40
votes
6 answers

How do I default to numeric keyboard on EditText without forcing numeric input?

This has been asked elsewhere online to no avail. Is there any way in Android to display the numeric soft keyboard when focusing on an EditText, but still allow any text to be entered? I'd like to let the user enter quantities (e.g. "1 kg", "2 L"),…
Lyudmil
  • 1,163
  • 2
  • 13
  • 21
39
votes
6 answers

How to add margin between EditText and Soft Keyboard?

I want to add 10dp margin between EditText and Soft Keyboard. Here is my XML:
31
votes
9 answers

android:windowSoftInputMode="adjustResize" doesn't make any difference?

I have a faux dialog which uses this layout:
Graeme
  • 25,714
  • 24
  • 124
  • 186
22
votes
3 answers

Hide keyboard after user searches?

I have an activity where there is an EditText and on enter key search results are shown, so what I simply want to do is to close the keyboard when search results are about to show to prevent the user from having to do it. However if the user wants…
Emil Davtyan
  • 13,808
  • 5
  • 44
  • 66
20
votes
9 answers

android making layout scrollable when soft keyboard open, but not shifting it upwards

This is my screen, with one button hidden behind the keyboard. I want exactly like this, but scrollable. - Whenever, the keyboard gets opened, I want to make look it the same as in image. But, instead to make it scrollable, so that the user can…
Narendra Singh
  • 3,990
  • 5
  • 37
  • 78
19
votes
2 answers

Keyboard overlapping EditText on click

In my fragment I have an editText inside a scrollview and when I click on that I set it to open like this: getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE |…
19
votes
5 answers

is there a default back key(on device) listener in android?

I am having two activities A and B. when i click the button in A that will shows B. when i click the Button in B it backs to A. i had set the overridePendingTransition method after the finish() method. it works properly. but in case the current…
Praveen
  • 90,477
  • 74
  • 177
  • 219
16
votes
2 answers

Android hide keyboard on btn click

I want to hide keyboard on click event of a button. Any help would be appreciated
user2041902
  • 593
  • 1
  • 6
  • 21
1
2 3
30 31