-2

I have searched a lot and could not find the solution for that.

The thing is that I am making a Custom Keyboard. I have an XML file for the layout of this custom keyboard, stored in res/xml.

The problem is, that I want to change the keyboard layout from the java code. For that, I need to Open the xml file from res/xml/qwerty.xml and edit it with DOM In the Java Code.

How can I do it? And if it isn't possible how can I build such a keyboard that I can change dynamically through out the java code.

Thanks in advance.

Noam Kahan
  • 31
  • 2

1 Answers1

1

Absolutely You can change our keypad dynamically. But you Must to specify our row and column static.

Try to change key value label in this way and u can also change primaryCode value is same way:

            if (rflag== 1) {
                mQwertyKeyboard.getKeys().get(29).label = "NewTag";
                rflag = 0;
            } else {
                rflag = 1;
                mQwertyKeyboard.getKeys().get(29).label = "OldTag";                 

            }
Avanish Singh
  • 767
  • 2
  • 8
  • 32
  • Nice.. But how can I make my rows and cols static? also, do you mean I need to make my java keyboard service static? and can I change the keyboard from outside the service of the custom keyboard? – Noam Kahan Oct 11 '15 at 07:08