That is it! You’ll now prevent the soft keyboard from showing when you open a page in your Android NativeScript app that has a textfield. It’s calling this native method: https://developer.android.com/reference/android/view/Window.html#setSoftInputMode(int) for reference. Again, this is the amazing power that NativeScript provides. Direct access to native Android and iOS APIs.

SearchBar Focus

I answered a question on StackOverflow about the focus being a SearchBar and here is the answer: http://stackoverflow.com/a/37868473/1893557. The code involves getting the parent layout and calling native Android methods for the focusing which prevents the keyboard from showing.

9 thoughts on “Preventing the Android Keyboard from Showing on Page Load in NativeScript App”

Hi Guys, nice tip. It’s helpul… I have one issue. Someone know how to hide Android Navigation Bar when keyboard is opened in fullscreen application (without status bar and navigation)… users can’t close my application on keyboard is opened, any suggestions?

It’s helpful, i’m running an android application in “Fullscreen immersive mode”, but when keyboard is opened a navigation bar appears too! Do you know how to hide the navigation bar when keyboard is opened?