i want to show four random numbers minimum one maximum ten but contains one number fix
<p>I want to show 4 options of numbers as like quiz options, out of four three should be wrong and one should be the right answer. All options are numeric numbers, and I want to change right answer's position every time when page opens. Please help me</p>

<p>and my result is in a String result, where i will add result.....</p>

<p>I'm trying this , but not getting the solution </p>

<pre><code>LinearLayout rowoptions = (LinearLayout) findViewById(R.id.linearlayout);
ArrayList&lt;Integer&gt; numbers = new ArrayList&lt;Integer&gt;();
String[] s = new String[4];
while (numbers.size() &lt; 4) {
    int random = r.nextInt(10)+1;
    int chk = r.nextInt(4)+1;
    if (!numbers.contains(random)) {
        numbers.add(random);
        s[chk] =String.valueOf(random);
    }
}

for (int i = 0; i &lt; 4; i++) {
    Button optionbutton = new Button(this);
    optionbutton.setText(s[i]);
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(70, 70);
    layoutParams.setMargins(5, 5, 0, 0); // left, top, right, bottom
    optionbutton.setLayoutParams(layoutParams);
    //ivBowl.setBackgroundDrawable(null);

    rowoptions.addView(optionbutton);
}
</code></pre>
