Android keyboard pauses app, and doesn't release it

Hello.

I’m confused by the workings of the Android keyboard. When opened, it seems to pause the Unity execution (no Update functions getting called etc). That would be acceptable (though not optimal, because I want to show the typed text in a text field), but it doesn’t even seem to release this lock when closed!

Below is a very simple bit of example code. If I run this on the Android device, I get debug lines only up to the point when I tap the screen to open the keyboard. After that, no matter what I do, it never gets into the Update function again. Except, if I press the Home button and resume the app via multitasking, it does resume.

public class AnroidKeyboardTester : MonoBehaviour {

	private TouchScreenKeyboard keyboard;

	public void Update(){
		Debug.Log("Update: " + Time.frameCount);
		if (Input.GetMouseButtonDown(0)){
			keyboard = TouchScreenKeyboard.Open("test", TouchScreenKeyboardType.Default, false, false, false, false);
		}
	}
}

Edit: one line does appear in the log once I press the “OK” button on the Android keyboard:

windowFocusChanged: true

It changes to false when I open the keyboard. So I think this focus is supposed to change back, but it’s not actually changing…

here you go buddy, u just need to switch it on/off using a lone boolean the following should work for you

if(Input.GetMouseButtonDown(0) && !kb)  {
   kb = true;
}
else if(Input.GetMouseButtonDown(0) && kb)  {
   kb = false;
}

if(kb) {
             keyboard = TouchScreenKeyboard.Open("test", TouchScreenKeyboardType.Default, false, false, false, false);

}

u will probably need some additional code(my knowledge on touchscreen technology is virtually non existant) however i have noticed that there is also

TouchScreenKeyboard.visible = true/false;

perhaps this is useful to ur situation.
if it doesn’t work let me know and i’ll do some research.