- Home /
How to prevent keyboard from showing in Android.
Hi, I need to prevent the keyboard from showing when an InputField is pressed in Android. To do the same in iOS I opened the Keyboard.mm file in the Xcode project that was built and just returned the method that was responsible for showing the keyboard. Now that I have to do the same for Android I have been looking through the AndroidPlayer files found in the Unity application's content folder and cannot seem to find anything similar to be able to edit.
Answer by Jessespike · Apr 01, 2015 at 04:24 PM
I haven't tested this, so it might not work... But try this:
Copy the AndroidManifest.xml from:
"C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer"
To your project:
"Assets/Plugins/Android/"
and add this line:
android:windowSoftInputMode="stateAlwaysHidden"
Hi, thanks but I have already tried this before posting the question. It seems to have no effect.