久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

以編程方式在android中的軟輸入鍵盤上禁用語音到

Disable speech to text button (Micro phone) on soft input keyboard in android programmatically(以編程方式在android中的軟輸入鍵盤上禁用語音到文本按鈕(麥克風))
本文介紹了以編程方式在android中的軟輸入鍵盤上禁用語音到文本按鈕(麥克風)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

提前感謝您的幫助.

我正在開發一個用于研究目的的 android 應用程序,并且需要禁用軟輸入鍵盤上的語音轉文本按鈕.其原因是由于我正在開發的應用程序使用麥克風而出現的并發問題.我知道對于一般應用程序,禁用鍵通常被認為是不可能的(因為用戶可能會更改默認鍵盤).我知道將使用默認鍵盤.

I am developing an android application for research purposes and need to disable the speech to text button on the soft input keyboard. The reason for this is due to concurrency issues that arise since the application I am developing uses the microphone. I understand that for a general application disabling keys is generally seen as impossible (since users may change default keyboards). I know for a fact that the default keyboard will be used.

考慮到這一點,是否可以禁用某些鍵?我相信至少我應該能夠指定輸入類型,以便隱藏麥克風按鈕.我這樣說是因為如果我在設置中禁用語音到文本(不是以編程方式,而是作為用戶手動),麥克風圖標就會從鍵盤上移除.我愿意接受任何可能的解決方案(不使用默認鍵盤除外),因為此應用程序不會出現在 Play 商店中.

With this in mind is it possible to disable certain keys? I believe that at the least I should be able to specify the input type such that the microphone button is hidden. I say this because if I disable speech to text in the settings (not programmatically, but manually as a user) the microphone icon is removed from the keyboard. I'm open to any possible solution (with the exception of not using the default keyboard) as this application will not appear on the play store.

推薦答案

除了用戶設備中已經存在的預定義鍵盤之外,您不能強制用戶輸入.

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.

只需在您正在查看的 EditText 中使用 XML 聲明以編程方式禁用語音輸入.你可以用屬性做到這一點:

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"   // nm stands for No Microphone.

如果你想以編程方式設置它,你可以試試這個::

If you want to set it programmatically you can try this::

        // deprecated i guess
        edt_txt.setPrivateImeOptions("nm");   
         // this one is new but it works only with Google Keyboard.
         edt_txt.setPrivateImeOptions("com.google.android.inputmethod.latin.noMicrophoneKey"); 

您可以在 CVS 表單中組合 PrivateImeOptions 參數中的值,因此最好的選擇是使用:

You can combine values in PrivateImeOptions parameter in CVS form so best option is to use:

                edt_txt.setPrivateImeOptions("nm,com.google.android.inputmethod.latin.noMicrophoneKey"); 

看看這里看看你有沒有可以找到您要查找的內容.

Take a look through here and see if you can find what you're looking for.

有關 Google 鍵盤的更多信息 這里 -> 尋找方法 setOptions

More info about Google Keyboard here -> look for method setOptions

這篇關于以編程方式在android中的軟輸入鍵盤上禁用語音到文本按鈕(麥克風)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設置為僅接受 Android 中的數值?)
主站蜘蛛池模板: 99爱在线视频 | 亚洲精品久久久久久久久久久 | 国产视频一区在线 | 四季久久免费一区二区三区四区 | av在线免费观看网站 | 在线播放日韩 | 国产精品片aa在线观看 | 一区二区在线 | 亚洲国产一区在线 | 西西裸体做爰视频 | 国产精品视频一区二区三区 | 成人影院在线观看 | 久久国产成人 | 欧美精品导航 | 精品av| 国产成人综合久久 | 懂色av色香蕉一区二区蜜桃 | 亚洲精品av在线 | 狠狠av | 永久免费av| 色桃网| 日韩影音 | 亚洲精品久久久久久一区二区 | 日本黄色的视频 | 成人免费看黄网站在线观看 | 免费观看国产视频在线 | 91 久久 | 97影院在线午夜 | 一区欧美 | 在线午夜电影 | 亚洲成人自拍 | 久久久国产精品入口麻豆 | 欧美性猛交一区二区三区精品 | 欧美888| 午夜精品久久久久久不卡欧美一级 | 国产精品久久久久久妇女6080 | 一本色道精品久久一区二区三区 | 成人3d动漫一区二区三区91 | 久久伊人青青草 | 日韩免费三级 | 午夜精品久久久久久不卡欧美一级 |