EugeneMi
EugeneMi

Reputation: 3575

How to prevent native Keyboard in PhoneGap build (on Android) from closing by itself?

I have a chat with the following html for input text

Type message...

On Android (haven't tried IOS), when the user clicks the send button, the keyboard closes by itself. I would like to prevent this behaviour. How would I got about it?

I tried to turn off the blur event, but it didn't help

Thanks!

Upvotes: 1

Views: 281

Answers (2)

vinay Maneti
vinay Maneti

Reputation: 1451

i think you are using setOnEditorActionListener or setOnKeyListener ? on both case try your return statement with true.........

Upvotes: 0

jimmithy
jimmithy

Reputation: 6380

you can make a keyboard always visible for an activity by adding the following in the manifest under the activity tag

android:windowSoftInputMode="stateAlwaysVisible"

So your manifest file should contain something like this

<activity android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysVisible" />

More Information can be found here: http://developer.android.com/guide/topics/manifest/activity-element.html

Upvotes: 1

Related Questions