Commit ad1210f13f2d21bfd34a1ca2fb39070aed33a5de
1 parent
100b8505
--no commit message
Showing
3 changed files
with
8 additions
and
8 deletions
src/com/upc/pbe/upcnews/Descarrega.java
... | ... | @@ -23,16 +23,16 @@ public class Descarrega extends AsyncTask<Object, Object, Object>{ |
23 | 23 | private String html; |
24 | 24 | private File arxiu; |
25 | 25 | |
26 | - public Descarrega(String nomarxiu, String carpeta) { | |
26 | + public Descarrega() { | |
27 | 27 | |
28 | - this.nomarxiu = nomarxiu; | |
29 | - this.carpeta = carpeta; | |
28 | + | |
30 | 29 | this.html = null; |
31 | 30 | this.arxiu = null; |
32 | 31 | } |
33 | 32 | |
34 | - public void descarregarguardar(String u) { | |
35 | - | |
33 | + public void descarregarguardar(String u, String nomarxiu, String carpeta) { | |
34 | + this.nomarxiu = nomarxiu; | |
35 | + this.carpeta = carpeta; | |
36 | 36 | this.url = u; |
37 | 37 | // Creem el directori |
38 | 38 | File dir = new File(carpeta); | ... | ... |
src/com/upc/pbe/upcnews/Directoris.java
... | ... | @@ -106,7 +106,7 @@ public class Directoris extends Activity implements OnClickListener { |
106 | 106 | |
107 | 107 | //Descarrega de la pàgina HTML del directori i busqueda d'un .m3u8 en ella |
108 | 108 | Log.d(TAG, "Click on " + b.getText()); |
109 | - d = new Descarrega(file, folder); | |
109 | + d = new Descarrega(); | |
110 | 110 | String str = d.doInBackground(url + "/" + b.getText() + "/"); |
111 | 111 | HTMLParser pars = new HTMLParser(); |
112 | 112 | String urlvideo = pars.findvideo(str, url + "/" + b.getText() + "/"); |
... | ... | @@ -116,7 +116,7 @@ public class Directoris extends Activity implements OnClickListener { |
116 | 116 | if (urlvideo.equalsIgnoreCase("No s'ha trobat")) { |
117 | 117 | Toast.makeText(this, "The directory " + b.getText() + " does not contain any '.m3u8' file", Toast.LENGTH_LONG).show(); |
118 | 118 | } else { |
119 | - d = new Descarrega(file, folder); | |
119 | + d = new Descarrega(); | |
120 | 120 | String m3u8 = d.doInBackground(urlvideo); |
121 | 121 | Parser p = new Parser(); |
122 | 122 | try { | ... | ... |
src/com/upc/pbe/upcnews/MainActivity.java
... | ... | @@ -81,7 +81,7 @@ public class MainActivity extends Activity implements OnClickListener { |
81 | 81 | } |
82 | 82 | |
83 | 83 | public void descarregar() { |
84 | - Descarrega d = new Descarrega(file, folder); | |
84 | + Descarrega d = new Descarrega(); | |
85 | 85 | Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); |
86 | 86 | html = (String) d.doInBackground(this.getUrl()); |
87 | 87 | } | ... | ... |