You can get around the letter of the Android law by moving the app’s UI management from the activity to one or more fragments.
A fragment is a controller object that an activity can deputize to perform tasks. Most commonly, the task is managing a UI. The UI can be an entire screen or just one part of the screen.
A fragment managing a UI is known as a UI fragment. A UI fragment has a view of its own that is inflated from a layout file. The fragment’s view contains the interesting UI elements that the user wants to see and interact with.
You can use the fragment(s) associated with the activity to compose and recompose the screen as your app and users require. The activity’s view technically stays the same throughout its lifetime, and no laws of Android are violated.
Ещё видео!