AbsoluteLayout/Custom Layouts

Do not use AbsoluteLayout! AbsoluteLayout is Deprecated! That said, there are times when using the AbsoluteLayout class makes sense. So why shouldn't you use the AbsoluteLayout class, and where should you use it? The answer to the first question is very simple all of the child widgets of an AbsoluteLayout have their locations specified exactly, they don't change size or location on different screens. It also makes your layout almost impossible to re-use (for example, importing it into another layout, or embedding it into another application).

If you're going to work with an AbsoluteLayout, you should approach it in either one of the following two ways:

  1. Carefully build a separate layout XML for each different screen ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.