Question:
The contentDescription
parameter (and method) several times. For example, in markup, I set it to 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 just can't figure out what it is for! I pressed and held the picture, but no effects, text, etc. So what is this contentDescription
and how does it manifest itself?
Answer:
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 a google application