How to get UIKeyboard size with iOS

You can get the keyboard size from the userInfo dictionary using the UIKeyboardFrameBeginUserInfoKey and the UIKeyboardFrameEndUserInfoKey instead. These two keys return a NSValue instance containing a CGRect that holds the position and size of the keyboard at both the start and end points of the keyboard’s show/hide animation. Edit: To clarify, the userInfo dictionary comes … Read more

Creating a SoftKeyboard with Multiple/Alternate characters per key

Implementing alternate key popup: For each key you wish to have a popup keyboard you should define popupCharacters and popupKeyboard: /res/xml/[Keyboard].xml <Key android:keyLabel=”(” android:popupKeyboard=”@xml/keyboard_popup_template” android:popupCharacters=”[{&lt;” /> The popupKeyboard is an XML representation of the keyboard used in the popup containing the alternate keys: /res/xml/keyboard_popup_template.xml <Keyboard xmlns:android=”http://schemas.android.com/apk/res/android” android:keyWidth=”10%p” android:horizontalGap=”0px” android:verticalGap=”0px” android:keyHeight=”56dp”> </Keyboard> Styling the alternate key … Read more

Android – Programmatically Hide/Show Soft Keyboard [duplicate]

UPDATE 2 @Override protected void onResume() { super.onResume(); mUserNameEdit.requestFocus(); mUserNameEdit.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub InputMethodManager keyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); keyboard.showSoftInput(mUserNameEdit, 0); } },200); //use 300 to make it run when coming back from lock screen } I tried very hard and found out a solution … whenever … Read more

Android: show soft keyboard automatically when focus is on an EditText

You can create a focus listener on the EditText on the AlertDialog, then get the AlertDialog‘s Window. From there you can make the soft keyboard show by calling setSoftInputMode. final AlertDialog dialog = …; editText.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); } } });