Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No speakable text present at Android Studio

Tags:

java

android

When adding a field for entering a number(Number widget), the error "No speakable text present at Android Studio" takes off

1

content_main.xml:

2

activity_main.xml:

3

like image 968
Иван Рогожкин Avatar asked Sep 12 '25 13:09

Иван Рогожкин


1 Answers

The problem is you are missing content labeling for the view, you should add content description so the user could simply understand what data he should enter into the view

for example, if you want the user to enter the number of cookies he wants you should add a content description as seen below:

android:contentDescription="Enter How Much Cookies You Want"

You should also add an android:hint so the user would have it in front of them an example of the data you want inputted for example:

android:hint="e.g 5"

So your views XML code should look as follows

<EditText
    android:id="@+id/editTextNumber2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:ems="10"
    android:inputType="number"
    android:minHeight="48dp"
    android:contentDescription="Enter How Much Cookies You Want" 
    android:hint="e.g 8" />
like image 183
Squash Avatar answered Sep 15 '25 04:09

Squash