Commit 5cc8bccf2f6d680c1cb24af580e7d4261fea3e6f

Authored by Imanol-Mikel Barba Sabariego
1 parent ef227bf5

--no commit message

src/com/upc/pbe/upcnews/Parser.java
... ... @@ -3,6 +3,8 @@ package com.upc.pbe.upcnews;
3 3 import java.net.MalformedURLException;
4 4 import java.util.ArrayList;
5 5  
  6 +import android.widget.Toast;
  7 +
6 8 public class Parser
7 9 {
8 10 private static final String STARTWORD = "#EXTM3U";
... ... @@ -13,7 +15,6 @@ public class Parser
13 15 private boolean expectSegment = false;
14 16 private boolean expectList = false;
15 17 private Descarrega download;
16   - Parser p = new Parser();
17 18  
18 19 public Parser()
19 20 {
... ... @@ -37,8 +38,18 @@ public class Parser
37 38 String[] lines = file.split("\n");
38 39 for(int i = 0; i < lines.length; i++)
39 40 {
40   -
41   - parseLine(lines[i],lists);
  41 + try
  42 + {
  43 + parseLine(lines[i],lists);
  44 + }
  45 + catch(InfoException iE)
  46 + {
  47 + //Toast.makeText(this, iE.getMessage(), Toast.LENGTH_SHORT).show();
  48 + }
  49 + catch(WarningException wE)
  50 + {
  51 +
  52 + }
42 53 }
43 54 /*
44 55 * Esto contiene una lista de RECURSOS,
... ... @@ -297,6 +308,7 @@ public class Parser
297 308 pl.setDefault(Default);
298 309 pl.setName(Name);
299 310 pl.setType(Type);
  311 + Parser p = new Parser();
300 312 p.parseFile(download.doInBackground(URI));
301 313 /*
302 314 * Procesar URI y descargar listas recursivamente y añadir a la lista actual.
... ... @@ -375,6 +387,7 @@ public class Parser
375 387 else if(expectList)
376 388 {
377 389 expectList = false;
  390 + Parser p = new Parser();
378 391 p.parseFile(download.doInBackground(line));
379 392 }
380 393 else
... ...