diff --git a/src/com/upc/pbe/upcnews/Descarrega.java b/src/com/upc/pbe/upcnews/Descarrega.java index ad88255..a6ee140 100644 --- a/src/com/upc/pbe/upcnews/Descarrega.java +++ b/src/com/upc/pbe/upcnews/Descarrega.java @@ -23,16 +23,16 @@ public class Descarrega extends AsyncTask{ private String html; private File arxiu; - public Descarrega(String nomarxiu, String carpeta) { + public Descarrega() { - this.nomarxiu = nomarxiu; - this.carpeta = carpeta; + this.html = null; this.arxiu = null; } - public void descarregarguardar(String u) { - + public void descarregarguardar(String u, String nomarxiu, String carpeta) { + this.nomarxiu = nomarxiu; + this.carpeta = carpeta; this.url = u; // Creem el directori File dir = new File(carpeta); diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index e452509..0cf72e0 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -106,7 +106,7 @@ public class Directoris extends Activity implements OnClickListener { //Descarrega de la pàgina HTML del directori i busqueda d'un .m3u8 en ella Log.d(TAG, "Click on " + b.getText()); - d = new Descarrega(file, folder); + d = new Descarrega(); String str = d.doInBackground(url + "/" + b.getText() + "/"); HTMLParser pars = new HTMLParser(); String urlvideo = pars.findvideo(str, url + "/" + b.getText() + "/"); @@ -116,7 +116,7 @@ public class Directoris extends Activity implements OnClickListener { if (urlvideo.equalsIgnoreCase("No s'ha trobat")) { Toast.makeText(this, "The directory " + b.getText() + " does not contain any '.m3u8' file", Toast.LENGTH_LONG).show(); } else { - d = new Descarrega(file, folder); + d = new Descarrega(); String m3u8 = d.doInBackground(urlvideo); Parser p = new Parser(); try { diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 1779dcc..750101a 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -81,7 +81,7 @@ public class MainActivity extends Activity implements OnClickListener { } public void descarregar() { - Descarrega d = new Descarrega(file, folder); + Descarrega d = new Descarrega(); Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); html = (String) d.doInBackground(this.getUrl()); }