Adding multiple ImageViews to a layout
<p>I need to load several ImageViews into a layout. The ImageViews are used to show a rating using  'star' icons. The number of stars (i.e. the rating is determined during loading by reading a configuration file.</p>

<p>The ImageViews are sitting inside a RelativeLayout layout.</p>

<p>Currently I am using something like this:</p>

<pre><code>RelativeLayout l = ((RelativeLayout)(findViewById(R.id.RelativeLayout01)));
for (int nStarCount = 0; nStarCount &lt; config.getAsInt("stars", 1); nStarCount ++) {
    ImageView image = new ImageView(this);
    image .setImageResource(R.drawable.star);
    image .setAdjustViewBounds(true); 
    l.addView(i); 
}
</code></pre>

<p>My quesions are:</p>

<p>1) Is doing the loading dynamically (not using an xml) is the 'right' way of doing this ?</p>

<p>2) If it is, how do I make the stars display in a line, currently they get placed one on top of the other.</p>

<p>Any help would be appreciated.</p>

<p>RM</p>
