0

I want to hide the mic from soft keyboard in my current application.

I have tried these possible solutions for the same.

Disable speech to text button (Micro phone) on soft input keyboard in android programmatically

But this solution is not working at all.

I found one unexpected thing, when add the inputType = “textFilter” then it works for me, I mean the mic is getting hidden.

But If possible then I want to have the exact solution for the problem, because If I adopt the mentioned “textFilter” thing then later times it may break.

I have tried on below O.S. versions

  1. Pie(API-28), Device - Pixel2XL
  2. Marshmallow(API-23), Device - MotoE3Power
Dr Mido
  • 2,414
  • 4
  • 32
  • 72
nikhil bansal
  • 449
  • 5
  • 15

1 Answers1

1

You can also define android:privateImeOptions="nm" in XML where nm = [no microphone]:

<AutoCompleteTextView
                        android:id="@+id/email"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:privateImeOptions="nm" />
Ali Azaz Alam
  • 1,782
  • 1
  • 16
  • 27