Hi all,

I’m nearly done with a game for Android, but I’m running into some issues with Unity’s text fields and the ICS keyboard, which I have noticed, as have 3 of my testers ( Stock Galaxy Nexus and Nexus S users ).

When the keyboard comes up for the first time, everything works as expected. If you dismiss it using the “Ok” button next to the popped up text entry, it works as expected. If you dismiss it with the “Done” button on the keyboard, the keyboard often does not present itself in other text fields and I can’t find a consistent to bring it back up. It sometimes takes a few attempts, but this is definitely reproducible.

I’m not using any custom handling of my text fields:

opponent = GUI.TextField(Helpers.ButtonRect(y), opponent, 60); 

Is there anything I can do to work around this issue? I am planning to release soon, and this is sadly a critical bug.

A beta version is online here so you can see: http://bit.ly/ItCVgu

Thanks,
David Goemans

Edit! I’ve changed the way I’ve done my workaround, so maybe it’ll be more effective.

I keep a reference in one of my classes to an instance of TouchScreenKeyboard:

private TouchScreenKeyboard keyboard = null;

in my Start(), I instanciate a keyboard:

keyboard = new TouchScreenKeyboard("", TouchScreenKeyboardType.Default, true, true, false, false, "");
keyboard.active = false;

then, when I want to ensure my keyboard is re-shown, I do:

keyboard.active = false;
TouchScreenKeyboard.Open("current text from text area", TouchScreenKeyboardType.Default, true, true, false, false, "");

I call that code when the user taps on an area that would be a text area. Something like this (pseudocode)

foreach (textarea t in alltextareas)
    if (Input.GetMouseDown(0) && t.MouseIsOver && t.IsClickable)
        ForceShowKeyboard()

Surely there’s a better way, but I imagine it will require Unity to change how they interact with the keyboard API on ICS.

Good luck!

Bug was fixed in 3.5.6