android - How to set a few imeOptions programmatically -
I And my secound question: how as EditText program after focus To make sure? This method is thanks try as follows . FrameLayout container in which I want to add dynamic
EditText . I have two
imeOptions needs to be set in the same time
IME_ACTION_DONE and
IME_FLAG_NO_EXTRACT_UI but the problem program to do it. My solution is my
imeOptions override (I now treat :) But I tried everything)
editText.requestFocus (); I did not work for me. I want to open the keyboard after
postCardContainer.addView (editText);
postCardContainer.setOnTouchListener (New View.OnTouchListener () {@Override see public boolean onTouch (V, MotionEvent event) {FrameLayout.LayoutParams parameter = new FrameLayout.LayoutParams (ViewGroup. LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); params.topMargin = (int) event.getY () - 50; params.leftMargin = (int) event .getX () - 50; editText editText = new editText (NewPostcardActivity.this ); editText.setSingleLine (); editText.setBackgroundResource (R.color.transparent); editText.requestFocus (); editText.setLayoutParams (parameters); editText. setCursorVisible (right); editText.setImeOptions (EditorInfo.IME_ACTION_DONE); editText. SetImeOptions (EditorInfo.IME_FLAG_NO_EXTRACT_UI); postCardContainer.addView (editText); return false;}});
editText.setImeOptions (editorInfo.IME_ACTION_DONE; editorInfo.IME_FLAG_NO_EXTRACT_UI);
Comments
Post a Comment