Online Course Support

What could be the interest of creating a button (or any other widget) from the Java code of an activity rather than from the associated XML layout file?

Question 4
What could be the interest of creating a button (or any other widget) from the Java code of an activity rather than from the associated XML layout file?

1 point

It makes it possible to create the button only if a given condition is fulfilled at runtime.

It requires fewer lines of code.

It makes it possible to associate with the button a text which changes according to the language settings of the device.

Similar Posts