Java Android: Pre-processing the UI before it displays
<p>First off, I've been reading this site for years now and it's helped me out of a bind several times, so thank you to the community here who contribute, and hopefully you can help me with a problem of my own.</p>

<p>I'm just starting out with Android development at my company and I'm attempting to port an existing application from Windows Mobile C# to Android Java. Most of it is going smoothly, but one area I'm having some difficulty is the UI.</p>

<p>The Windows Mobile application reads in a survey specification from a file when the WinForm is created. In the case of a closed-ended question (such as multiple choice), I need to populate the screen with either a CheckBox or RadioButton control for each applicable answer in the spec. Creating the layout and controls required is no problem, but we also have a requirement that the screen does not scroll. Because of this our software needs to be able to calculate the best possible fit within the available screen space without overflow (ie. 1-4 columns used for display) before it's displayed</p>

<p>I have written my UI (at least the layout) as both an XML resource or Java code, but because methods like GetWidth() and GetHeight() return 0 in onCreate(), I haven't yet been able to add this required pre-processing.</p>

<p>All of this needs to happen prior to the screen showing. If anyone can point me in the right direction, I would be immensely grateful.</p>
