From 61aed4a11f182823c0d234cf85665d089979c969 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Wed, 28 Nov 2012 18:26:34 +0000 Subject: [PATCH] He canviat el /" per /index.html" en el HTMLParser --- src/com/upc/pbe/upcnews/Directoris.java | 3 +++ src/com/upc/pbe/upcnews/HTMLParser.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index d89004e..b246a5a 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -35,9 +35,12 @@ public class Directoris extends Activity implements OnClickListener { this.crearButtons(); s = ((UpcApp) getApplication()).getDesc(); + + HTMLParser pars = new HTMLParser(); ArrayList dirs = pars.parse(s); + Log.d(TAG, dirs.toString()); for (int i = 0; i < dirs.size(); i++) { Log.d(TAG, "Directori " + i); buttons.get(i).setVisibility(View.VISIBLE); diff --git a/src/com/upc/pbe/upcnews/HTMLParser.java b/src/com/upc/pbe/upcnews/HTMLParser.java index 0d9ec56..dea409f 100644 --- a/src/com/upc/pbe/upcnews/HTMLParser.java +++ b/src/com/upc/pbe/upcnews/HTMLParser.java @@ -18,8 +18,8 @@ public class HTMLParser { //Mirem a cada linia si conté un href, i hi haurà un directori si conté el conjunt /" //Si hi ha un directori, tallem l'string per obtenir-ne el nom. for(int i = 0; i < split.length; i++){ - if(split[i].contains("href") && split[i].contains("/\"")){ - directoris.add(split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/\"")))); + if(split[i].contains("href") && split[i].contains("/index.html\"")){ + directoris.add(split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/index.html\"")))); } } return directoris; -- libgit2 0.22.2