It is necessary in the program code to call the input method selection window. How can I do that? If through intent-filters, then by what word?
I explain: I have an edittext in which I intercept clicks using onTouch. In the OnTouch method, I invoke the keyboard and perform a few more actions. However, the ability to select the input method with a long press on edittext was lost. Here, I'm trying to get her back.
Code:
EditText et = (EditText) findViewById(R.id.answer); et.setOnTouchListener(this); public boolean onTouch(View v, MotionEvent me) { Answer.super.onTouchEvent(me); //Пытаюсь обработать нажатие по обычному, но безуспешно if (me.getAction() == MotionEvent.ACTION_DOWN & v.getId() == R.id.answer) { Answer.super.onTouchEvent(me); EditText et = (EditText) findViewById(R.id.answer); // Показ клавиатуры InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(et, 0); //Как раз то, ради чего создавался OnTouch: ((LockableScrollView)findViewById(R.id.scroll)).setScrollingEnabled(true); return true; } else if (me.getAction() == MotionEvent.ACTION_UP) { Answer.super.onTouchEvent(me); ((LockableScrollView)findViewById(R.id.scroll)).setScrollingEnabled(true); return true; } Answer.super.onTouchEvent(me); return false; }