I'm not very experienced with android programming and I would like to know one thing. I would like to know if it was possible to set the layout of an application, in blocks. For instance now I use the layout as it was a frame in java, you can use the layout as the panels, as is done in java? Can I have more panels in the same layout?
3 Answers
You can think of Views in android as being similar to Panels in java swing. Layouts like GridLayout, TableLayout, ReleativeLayout, LinearLayout etc allow you to add multiple Views to them. This is similar to adding Panels to a container in swing.

- 5,263
- 5
- 30
- 47
In my (very limited) experience of Android, I noted that Google strongly discouraged nesting layouts inside one another, citing (and this astonished me) 'performance'.
So the answer might be read as, 'yes it is possible, but it is not a good idea'.

- 168,117
- 40
- 217
- 433
-
Yes, it may be possible if you make both the panels dynamic, but if I use one panel only to handle a button, I don't think that performance are affected. – Samjack Dec 02 '13 at 13:15
-
Nested layouts are common in android. But you are right, for performance reasons you should try to keep the depth of nesting to a minimum. – Sound Conception Dec 02 '13 at 13:15
Nesting layouts is unavoidable in Android. For instance the standard spinner widget is a textview and a button inside another layout.
The problem comes if you use nested weights. This can severely impact performance as each layout would need to be measured twice (3 times for a 3rd nesting level etc)