The Android tutorial mentions the parameter (and method) contentDescription several times. For example, in the markup I installed it in ImageView :

 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" > <ImageView android:layout_width="200dp" android:layout_height="100dp" android:contentDescription="LOGO!" android:src="@drawable/starbuzz_logo" /> <ListView android:id="@+id/list_options" android:layout_width="match_parent" android:layout_height="wrap_content" android:entries="@array/options" /> </LinearLayout> 

But I can not understand what it is for! On the picture and clicked, and held, but no effects, text, and so on. So what is this contentDescription and how does it appear?

    1 answer 1

    This is for the visually impaired. The text in the value of this attribute will be voiced by the system when you click on the picture if the corresponding option is enabled in the device settings.

    Voice acting goes through Google application

    • 6
      I would like to add that this is a very important attribute. I never thought about it until a blind person wrote to me. I had to debug the whole program for several days so that such people could use it. Usually use talkback. Another such moment is the text in the form of html, so for the sighted it can be seen beautifully, but TalkBack can start reading tags and other Labud. It was necessary to prescribe pure text in such components. - dubok79