title: I wanto randomize my csv file for a quizz game
body: <p>i have my quizz game reading a csv file to get the questions but i dont know how to randomize them for every time start the game i dont know if its possible with the code i have and i dont want to change to sql or sqllite because i already did this way and i want to finish like that, thats my code to read the file</p>
  <pre><code>import android.content.Context;
  import java.io.InputStream;
  import java.util.ArrayList;
  import java.util.List;
  
  public class CsvFileReader {
  
      public ArrayList&lt;Question&gt; readFile(Context ctx){
          ArrayList&lt;Question&gt; questions = new ArrayList&lt;&gt;();
          InputStream inputStream = ctx.getResources().openRawResource(R.raw.question);
          CSVFile csvFile = new CSVFile(inputStream);
          List&lt;String[]&gt; scoreList = csvFile.read();
  
        for (int i=1;i&lt;scoreList.size();i++)
          {
              String[] strings = scoreList.get(i);
  
              int questionId = 0;
              String question = &quot;&quot;;
              int dificulty = 0;
              int correctAnswer = 0;
              String answer1 = &quot;&quot;;
              String answer2 = &quot;&quot;;
              String answer3 = &quot;&quot;;
              String answer4 = &quot;&quot;;
  
              int length = strings.length;
              if (length&gt;0){
  
                  try {
                      questionId = Integer.parseInt(strings[0]);
                  }catch (Exception ex){
  
                  }
  
              }
              if (length&gt;1){
  
                  question = strings[1];
              }
  
              if (length&gt;2){
                  try {
                      dificulty = Integer.parseInt(strings[2]);
                  }catch (Exception ex){
  
                  }
  
              }
  
              if (length&gt;3){
              try {
                  correctAnswer = Integer.parseInt(strings[3]);
              }catch (Exception ex){
  
              }
              }
  
  
              if (length&gt;4){
                  answer1 = strings[4];
  
              }
  
              if (length&gt;5){
                  answer2 = strings[5];
              }
  
              if (length&gt;6){
                  answer3 = strings[6];
              }
  
              if (length&gt;7){
                  answer4 = strings[7];
              }
  
  
  
              Question questionData = new Question(questionId,question,dificulty,correctAnswer,answer1,answer2,answer3,answer4);
  
  
              questions.add(questionData);
          }
        
          return  questions;
      }
  }
  </code></pre>
  <p>i want every time i start the quizz need to randomize the questions and down there is the code from the file</p>
  <pre><code>import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.util.ArrayList;
  import java.util.List;
  
  public class CSVFile {
      InputStream inputStream;
  
      public CSVFile(InputStream inputStream){
          this.inputStream = inputStream;
      }
  
      public List read(){
          List resultList = new ArrayList();
          BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
          try {
              String csvLine;
              while ((csvLine = reader.readLine()) != null) {
                  String[] row = csvLine.split(&quot;,&quot;);
                  resultList.add(row);
              }
          }
          catch (IOException ex) {
              throw new RuntimeException(&quot;Error reading: &quot;+ex);
          }
          finally {
              try {
                  inputStream.close();
              }
              catch (IOException e) {
                  throw new RuntimeException(&quot;Error while closing input stream: &quot;+e);
              }
          }
          return resultList;
      }
  }
  </code></pre>
  <p>if someone need more code to get in or whatever let me know i would appreciate the help.</p>