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 | 17 | final static String TAG = "Directoris"; |
18 | 18 | String s; |
19 | 19 | Descarrega d; |
20 | - String url; | |
20 | + String url; | |
21 | 21 | String file = "ejemplo.xml"; |
22 | 22 | String folder = "Environment.getExternalStorageDirectory.getPath()"; |
23 | 23 | |
... | ... | @@ -69,29 +69,35 @@ public class Directoris extends Activity implements OnClickListener { |
69 | 69 | } |
70 | 70 | |
71 | 71 | public void onClick(View c) { |
72 | - | |
72 | + | |
73 | 73 | switch (c.getId()) { |
74 | 74 | |
75 | 75 | case R.id.button1: { |
76 | 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 | 79 | String str = d.doInBackground(); |
79 | - | |
80 | + | |
80 | 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 | 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 | 93 | case R.id.button2: { |
88 | - | |
94 | + | |
89 | 95 | } |
90 | 96 | case R.id.button3: { |
91 | - | |
97 | + | |
92 | 98 | } |
93 | 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 | 113 | buttons.add(button2); |
108 | 114 | buttons.add(button3); |
109 | 115 | buttons.add(button4); |
110 | - | |
116 | + | |
111 | 117 | button1.setOnClickListener(this); |
112 | 118 | button2.setOnClickListener(this); |
113 | 119 | button3.setOnClickListener(this); |
114 | 120 | button4.setOnClickListener(this); |
115 | - | |
121 | + | |
116 | 122 | button1.setVisibility(View.GONE); |
117 | 123 | button2.setVisibility(View.GONE); |
118 | 124 | button3.setVisibility(View.GONE); | ... | ... |