From 5cc8bccf2f6d680c1cb24af580e7d4261fea3e6f Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Wed, 5 Dec 2012 13:43:06 +0000 Subject: [PATCH] --- src/com/upc/pbe/upcnews/Parser.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/com/upc/pbe/upcnews/Parser.java b/src/com/upc/pbe/upcnews/Parser.java index 74750e3..8a7d0f7 100644 --- a/src/com/upc/pbe/upcnews/Parser.java +++ b/src/com/upc/pbe/upcnews/Parser.java @@ -3,6 +3,8 @@ package com.upc.pbe.upcnews; import java.net.MalformedURLException; import java.util.ArrayList; +import android.widget.Toast; + public class Parser { private static final String STARTWORD = "#EXTM3U"; @@ -13,7 +15,6 @@ public class Parser private boolean expectSegment = false; private boolean expectList = false; private Descarrega download; - Parser p = new Parser(); public Parser() { @@ -37,8 +38,18 @@ public class Parser String[] lines = file.split("\n"); for(int i = 0; i < lines.length; i++) { - - parseLine(lines[i],lists); + try + { + parseLine(lines[i],lists); + } + catch(InfoException iE) + { + //Toast.makeText(this, iE.getMessage(), Toast.LENGTH_SHORT).show(); + } + catch(WarningException wE) + { + + } } /* * Esto contiene una lista de RECURSOS, @@ -297,6 +308,7 @@ public class Parser pl.setDefault(Default); pl.setName(Name); pl.setType(Type); + Parser p = new Parser(); p.parseFile(download.doInBackground(URI)); /* * Procesar URI y descargar listas recursivamente y aƱadir a la lista actual. @@ -375,6 +387,7 @@ public class Parser else if(expectList) { expectList = false; + Parser p = new Parser(); p.parseFile(download.doInBackground(line)); } else -- libgit2 0.22.2