getting error in android
<p>i have parsed data successfully using sax parser and output is coming properly in logcat but i have to arrange that data systematically. But the problem is my question length and index is 2 so options are also coming 2. instead they are 4 for each question. please suggest</p>

<p>code snippet is</p>

<pre><code>for (int i = 0; i &lt; categorylist.getTitle().size(); i++) {

            TableRow tr = new TableRow(this);
            tr.setPadding(2, 2, 2, 2);

            TableLayout.LayoutParams tableRowParams=
                  new TableLayout.LayoutParams
                  (TableLayout.LayoutParams.FILL_PARENT,TableLayout.LayoutParams.FILL_PARENT);

            int leftMargin=0;
            int topMargin=2;
            int rightMargin=0;
            int bottomMargin=1;

            tableRowParams.setMargins(leftMargin, topMargin, rightMargin, bottomMargin);

            tr.setLayoutParams(tableRowParams);

            name[i]= new TextView(this);
            name[i].setText(categorylist.getTitle().get(i));
            name[i].setTextColor(Color.WHITE);
            name[i].setTextSize(12);
            name[i].setPadding(10,0,0,0);
            name[i].setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
            tr.addView(name[i]);
            t1.addView(tr, tableRowParams);

            LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(
                    RadioGroup.LayoutParams.WRAP_CONTENT,
                    RadioGroup.LayoutParams.WRAP_CONTENT);

            rad1[i]= new RadioButton(this);
            rad1[i].setText(categorylist.getValue().get(i));    
            rad1[i].setTextColor(Color.WHITE);
            rad1[i].setTextSize(12);
            rad1[i].setPadding(10,0,0,0);
            rad1[i].setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
            rgrp.addView(rad1[i], 0, layoutParams);

        }
</code></pre>

<p>and xml is</p>

<pre><code>&lt;Values&gt;
&lt;Question&gt;

&lt;Description&gt;&lt;![CDATA[Some Question]]&gt;&lt;/Description&gt;

                    &lt;Options&gt;

                        &lt;option value="correct"&gt;&lt;![CDATA[All of these]]&gt;&lt;/option&gt;

                        &lt;option value="incorrect"&gt;&lt;![CDATA[Ok]]&gt;&lt;/option&gt;

                        &lt;option value="incorrect"&gt;&lt;![CDATA[Fine]]&gt;&lt;/option&gt;

                        &lt;option value="incorrect"&gt;&lt;![CDATA[Good one]]&gt;&lt;/option&gt;





                    &lt;/Options&gt;  

            &lt;/Question&gt;

&lt;/Values&gt;
</code></pre>

<p>logcat output is:</p>

<pre><code>05-14 15:22:27.228: INFO/This is the title:(559): Which of the following are called celestial bodies?
05-14 15:22:27.248: INFO/This is the option:(559): All of these
05-14 15:22:27.248: INFO/This is the option:(559): Sun
05-14 15:22:27.248: INFO/This is the option:(559): Planets
05-14 15:22:27.248: INFO/This is the option:(559): Moon 
05-14 15:22:27.258: INFO/This is the title:(559): In our solar system, _________ planets revolve around the Sun.
05-14 15:22:27.258: INFO/This is the option:(559): eight
05-14 15:22:27.258: INFO/This is the option:(559): five
05-14 15:22:27.258: INFO/This is the option:(559): ten
05-14 15:22:27.258: INFO/This is the option:(559): nine
</code></pre>
