I have a list with two or more Strings:
[Panel, Control]
Now comes the problem:
for (int i = 0; i < lista.size(); i++){
String linha = "";
while ((linha = leitura.readLine()) != null){
if (linha.contaens(lista.get(i))){
System.out.println(lista);
1 - Performs for for with i equal to 0.
2 - Run the while and read row by line by looking for the first string of the list until it reaches null
.
3 - The for is called again with i equal to 1.
4 - While it does not execute, leitura.readLine()
becomes null
.
5 - How do I do while to execute until lista.size()
times? Until the list finishes.
In my code it only fetches the first String from the list, but the next one does not execute because the line turned null on the first search.