Generate questions randomly and non repaeted from the xml file in android
<p>I have a xml file having 50 different questions and i need only 15 out of them randomly and non-repeated.I used the code below</p>

<pre><code>int n = ((int)(Math.random()*100))%50;
if(temp&lt;15)
{
    for(int i=0;i&lt;temp;i++)
    {
        System.out.println("hello naresh");
        if(n==check[i])
        {
            n=((int)(Math.random()*100))%50;
        }
    }
    check[temp]=n;
}

temp++;
return n;
</code></pre>

<p>But by using this some questions are repeated.Please suggest me something which help me to generate the non-repeated questions.</p>
