android - How to set a few imeOptions programmatically -


I 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)

And my secound question: how as EditText program after focus To make sure? This method is 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;}});   

thanks

try as follows . editText.setImeOptions (editorInfo.IME_ACTION_DONE; editorInfo.IME_FLAG_NO_EXTRACT_UI);

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -