Updating a Text Switcher Control

When you want to update a TextSwitcher control with a new TextView control, you can call the setText() method:

TextSwitcher questionTextSwitcher = (TextSwitcher)

findViewById(R.id.TextSwitcher_QuestionText); questionTextSwitcher.setText(MNext Text String");

Calling the setText() method causes MyTextSwitcherFactory to generate a new TextView control with the String contents supplied in the setText() parameter.

Working with ImageSwitcher

The ImageSwitcher control enables an activity to animate between two ImageView controls. You have included an ImageSwitcher control called ImageSwitcher_ QuestionImage in the layout of the game screen to display each trivia question image to the user.

0 0

Post a comment