I have my activity subclass which has my app logic. I want to add UI Elements to the Activity and then when view hierarchy is ready, then I want to start the activity. Is it possible in Android? I can do this is IOS. I can create a ViewController instance and then manipulate the view property and when I want, I can set the View Controller as the root controller.
2 Answers
Yes I suppose,
When you look for the cycle of life of an activity you have the onCreate that will create you view and the onStart that will start your view.
I suppose you can had you Ui on the create and it will be ready, when onStart will be called
But I'm not sure that is the best way to do it. What kind of Ui you would like to add?

- 155
- 1
- 14
I think the answer to your question is no.
In iOS you create your next view controller before starting it and modify the view controller as you like. However, in android you do not directly create your next activity. Instead, you use an intent to ask the system to create your new activity. If you want to modify the UI in your new activity you will need to pass extras inside of the intent and read them in the new activity's onCreate method. This SO post describes how to pass an extra from one activity to another.

- 1
- 1

- 1,662
- 1
- 12
- 16