Android: Target a TextView

Written by Zac Vineyard

In order modify their properties (like the text they contain) Android developers often rely on targeting views in their code. The small code example below targets a view with the ID of humidity and appends some text to it.

In order to target a view, you have to declare it in a layout XML file. That deceleration would look something like this: