Commit 34063849e103abfdf085c95a2a1b7c16df493dd0
1 parent
072c72e8
--no commit message
Showing
1 changed file
with
19 additions
and
13 deletions
src/com/upc/pbe/upcnews/Directoris.java
@@ -17,7 +17,7 @@ public class Directoris extends Activity implements OnClickListener { | @@ -17,7 +17,7 @@ public class Directoris extends Activity implements OnClickListener { | ||
17 | final static String TAG = "Directoris"; | 17 | final static String TAG = "Directoris"; |
18 | String s; | 18 | String s; |
19 | Descarrega d; | 19 | Descarrega d; |
20 | - String url; | 20 | + String url; |
21 | String file = "ejemplo.xml"; | 21 | String file = "ejemplo.xml"; |
22 | String folder = "Environment.getExternalStorageDirectory.getPath()"; | 22 | String folder = "Environment.getExternalStorageDirectory.getPath()"; |
23 | 23 | ||
@@ -69,29 +69,35 @@ public class Directoris extends Activity implements OnClickListener { | @@ -69,29 +69,35 @@ public class Directoris extends Activity implements OnClickListener { | ||
69 | } | 69 | } |
70 | 70 | ||
71 | public void onClick(View c) { | 71 | public void onClick(View c) { |
72 | - | 72 | + |
73 | switch (c.getId()) { | 73 | switch (c.getId()) { |
74 | 74 | ||
75 | case R.id.button1: { | 75 | case R.id.button1: { |
76 | Log.d(TAG, "Click on button1"); | 76 | Log.d(TAG, "Click on button1"); |
77 | - d = new Descarrega(url + "/" + button1.getText() + "/", file, folder); | 77 | + d = new Descarrega(url + "/" + button1.getText() + "/", file, |
78 | + folder); | ||
78 | String str = d.doInBackground(); | 79 | String str = d.doInBackground(); |
79 | - | 80 | + |
80 | HTMLParser pars = new HTMLParser(); | 81 | HTMLParser pars = new HTMLParser(); |
81 | - String urlvideo = pars.findvideo((String) button1.getText(), | ||
82 | - str, url + "/" + button1.getText() + "/"); | ||
83 | - | 82 | + String urlvideo = pars.findvideo((String) button1.getText(), str, |
83 | + url + "/" + button1.getText() + "/"); | ||
84 | + | ||
84 | Log.d(TAG, urlvideo); | 85 | Log.d(TAG, urlvideo); |
85 | - | 86 | + |
87 | + d = new Descarrega(urlvideo, file, folder); | ||
88 | + String m3u8 = d.doInBackground(); | ||
89 | + | ||
90 | + Log.d(TAG, m3u8); | ||
91 | + | ||
86 | } | 92 | } |
87 | case R.id.button2: { | 93 | case R.id.button2: { |
88 | - | 94 | + |
89 | } | 95 | } |
90 | case R.id.button3: { | 96 | case R.id.button3: { |
91 | - | 97 | + |
92 | } | 98 | } |
93 | case R.id.button4: { | 99 | case R.id.button4: { |
94 | - | 100 | + |
95 | } | 101 | } |
96 | } | 102 | } |
97 | } | 103 | } |
@@ -107,12 +113,12 @@ public class Directoris extends Activity implements OnClickListener { | @@ -107,12 +113,12 @@ public class Directoris extends Activity implements OnClickListener { | ||
107 | buttons.add(button2); | 113 | buttons.add(button2); |
108 | buttons.add(button3); | 114 | buttons.add(button3); |
109 | buttons.add(button4); | 115 | buttons.add(button4); |
110 | - | 116 | + |
111 | button1.setOnClickListener(this); | 117 | button1.setOnClickListener(this); |
112 | button2.setOnClickListener(this); | 118 | button2.setOnClickListener(this); |
113 | button3.setOnClickListener(this); | 119 | button3.setOnClickListener(this); |
114 | button4.setOnClickListener(this); | 120 | button4.setOnClickListener(this); |
115 | - | 121 | + |
116 | button1.setVisibility(View.GONE); | 122 | button1.setVisibility(View.GONE); |
117 | button2.setVisibility(View.GONE); | 123 | button2.setVisibility(View.GONE); |
118 | button3.setVisibility(View.GONE); | 124 | button3.setVisibility(View.GONE); |