C
C
Chvalov2015-04-27 22:37:01
Android
Chvalov, 2015-04-27 22:37:01

Own keyboard for Text Fields, how to do it?

You need to call your keyboard for all text fields, in which there are only numbers and symbols.
How to implement this in your project.
P.S. The keyboard is needed in the interior of the project, and not written separately.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
one pavel, 2015-04-27
@onepavel

So what's the problem?
If you don't want to do full-fledged clave
code.tutsplus.com/tutorials/create-a-custom-keyboa... ,
Create a layout based on TableLayout or GridLayout and load via ViewStub.
Or quite simply, limit the input characters to the text field
developer.android.com/reference/android/widget/Tex...
stackoverflow.com/questions/3349121/how-do-i-use-i...
developer.android. com/reference/android/text/TextW...

M
Marina, 2015-04-28
@MJee

Create a layout with the necessary buttons, in the code for each button you hang a handler

new OnClickListener() {
@Override
      public void onClick(View v) {
        new Thread(new Runnable() {
          @Override
          public void run() {
            Instrumentation instr = new Instrumentation();
            instr.sendKeyDownUpSync(KeyEvent.KEYCODE_0);
          }
        }).start();
      }
    }

KeyEvent.KEYCODE_0 respectively replace with the desired constant

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question