how to display a random row from a table in android
<p>i have to select a random row from a table and display it on buttons and textview... what i am using it .....</p>

<p>Cursor result=sqldb.rawQuery("SELECT * FROM quiztable ORDER BY RANDOM() LIMIT 1",null );</p>

<pre><code>            String ques=result.getString(1);
            String op1=result.getString(2);
            String op2=result.getString(3);
            String op3=result.getString(4);
            String ans=result.getString(5);
            txt17.setText(ques);
            btn10.setText(op1);
            btn11.setText(op2);
            btn12.setText(op3);
</code></pre>

<p>but the record is not displayed.... i tried try and catch block and display the error using toast .... its say "index -1 requested,with a size 1"</p>

<p>Whts the error in the code?? can any1 tell the solution for it??</p>

<p>thank you in advance .... </p>
