Commit 61aed4a11f182823c0d234cf85665d089979c969
1 parent
388538e7
He canviat el /" per /index.html" en el HTMLParser
Showing
2 changed files
with
5 additions
and
2 deletions
src/com/upc/pbe/upcnews/Directoris.java
... | ... | @@ -35,9 +35,12 @@ public class Directoris extends Activity implements OnClickListener { |
35 | 35 | this.crearButtons(); |
36 | 36 | |
37 | 37 | s = ((UpcApp) getApplication()).getDesc(); |
38 | + | |
39 | + | |
38 | 40 | HTMLParser pars = new HTMLParser(); |
39 | 41 | ArrayList<String> dirs = pars.parse(s); |
40 | 42 | |
43 | + Log.d(TAG, dirs.toString()); | |
41 | 44 | for (int i = 0; i < dirs.size(); i++) { |
42 | 45 | Log.d(TAG, "Directori " + i); |
43 | 46 | buttons.get(i).setVisibility(View.VISIBLE); | ... | ... |
src/com/upc/pbe/upcnews/HTMLParser.java
... | ... | @@ -18,8 +18,8 @@ public class HTMLParser { |
18 | 18 | //Mirem a cada linia si conté un href, i hi haurà un directori si conté el conjunt /" |
19 | 19 | //Si hi ha un directori, tallem l'string per obtenir-ne el nom. |
20 | 20 | for(int i = 0; i < split.length; i++){ |
21 | - if(split[i].contains("href") && split[i].contains("/\"")){ | |
22 | - directoris.add(split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/\"")))); | |
21 | + if(split[i].contains("href") && split[i].contains("/index.html\"")){ | |
22 | + directoris.add(split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/index.html\"")))); | |
23 | 23 | } |
24 | 24 | } |
25 | 25 | return directoris; | ... | ... |