开发者

Hide microphone button Android virtual keyboard

开发者 https://www.devze.com 2023-04-04 19:36 出处:网络
I wanted to know if is it possible to hide the microphone button (speech-to-text) in Android Virtual Keyboard programatically.

I wanted to know if is it possible to hide the microphone button (speech-to-text) in Android Virtual Keyboard programatically.

I know I can disable this option through device settings, but I don't want the user to use this feature in my application independently of his/her settings. I mean i want to force this behaviour inside my app.

Thanks in advance开发者_JAVA技巧, Demian


Here's how you do it: android:privateImeOptions="nm" - nm stands for No Microphone.


You can't force the user input through anything other than pre-defined keyboards that already exist in the user's device.

The only way you could get around this is by programming your own custom, on-the-fly keyboard, and that is a very bad idea.

Just disable voice input programmatically by using XML declarations in the EditText you're looking at. You can do this with the attribute:

android:privateImeOptions="nm"
0

精彩评论

暂无评论...
验证码 换一张
取 消