Commit 2ad5a7ce66b0a2cf4164969a2ec20c861eeea30c
1 parent
0f2135e9
--no commit message
Showing
1 changed file
with
11 additions
and
0 deletions
src/com/upc/pbe/upcnews/VideoActivity.java
@@ -20,6 +20,7 @@ import android.net.TrafficStats; | @@ -20,6 +20,7 @@ import android.net.TrafficStats; | ||
20 | import android.os.AsyncTask; | 20 | import android.os.AsyncTask; |
21 | import android.os.Bundle; | 21 | import android.os.Bundle; |
22 | import android.util.Log; | 22 | import android.util.Log; |
23 | +import android.view.KeyEvent; | ||
23 | import android.view.View; | 24 | import android.view.View; |
24 | import android.widget.Toast; | 25 | import android.widget.Toast; |
25 | 26 | ||
@@ -200,6 +201,16 @@ public class VideoActivity extends Activity { | @@ -200,6 +201,16 @@ public class VideoActivity extends Activity { | ||
200 | super.onConfigurationChanged(newConfig); | 201 | super.onConfigurationChanged(newConfig); |
201 | } | 202 | } |
202 | 203 | ||
204 | + public boolean onKeyDown(int keyCode, KeyEvent event) { | ||
205 | + // Determina el funcionament al apretar la tecla de tornar enrere | ||
206 | + if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { | ||
207 | + toggleBuffering(false); | ||
208 | + super.finish(); | ||
209 | + return true; | ||
210 | + } | ||
211 | + return super.onKeyDown(keyCode, event); | ||
212 | + } | ||
213 | + | ||
203 | public class DescarregaSegment extends AsyncTask<URL, Void, Void> | 214 | public class DescarregaSegment extends AsyncTask<URL, Void, Void> |
204 | { | 215 | { |
205 | final static String TAG = "DescarregaSegment"; | 216 | final static String TAG = "DescarregaSegment"; |