android-keypad
How do I default to numeric keyboard on EditText without forcing numeric input? [duplicate]
Add the following line of code, and it will do the trick 🙂 editText.setRawInputType(Configuration.KEYBOARD_QWERTY); This will show the the numeric keypad first, but also allows you to enter free text. More information here.
Android Keyboard hides EditText
In manifest add this line on the particular activity tag: android:windowSoftInputMode=”adjustPan”
EditText with number keypad by default, but allowing alphabetic characters
Define your EditText in your xml this way: <EditText android:id=”@+id/txtOppCodigoCliente” android:inputType=”textVisiblePassword” android:layout_width=”match_parent” android:layout_height=”match_parent” android:maxLength=”11″ android:hint=”@string/strCodigoCliente”/> output: android:inputType=”textVisiblePassword” A row of numbers and the rest of letters.
Get Cursor Position in Android in Edit Text?
You can get the Cursor position using the getSelectionStart() and getSelectionEnd() methods. If no text is highlighted, both getSelectionStart() and getSelectionEnd() return the position of the cursor. So something like this should do the trick: myEditText.getSelectionStart(); or myEditText.getSelectionEnd(); Then if you want to select all the text after the cursor you could use this: int …
Page scroll when soft keyboard popped up
I fixed the problem by defining the following attribute in <activity> of AndroidManifest.xml android:windowSoftInputMode=”adjustResize”
How to disable copy/paste from/to EditText
Best method is to use: etUsername.setLongClickable(false);
Move layouts up when soft keyboard is shown?
Yes, check out this article on the Android developers’ site which describes how the framework handles the soft keyboard appearing. The android:windowSoftInputMode attribute can be used to specify what happens on a per-activity basis: whether the layout is resized or whether it scrolls etc.
Prevent the keyboard from displaying on activity start
I think the following may work getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); I’ve used it for this sort of thing before.