If I have an xml button in a file called test.xml like this:
<Button
android:id="@+id/newgame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="New Game"
/>
Is it possible to change the “New game” text to something else? I have to do this many times.
The big problem is: I have to do it from inside a java file! Is that even possible?
Yes.
1) Get a reference to the Button
2) use the setText method to give text a new value