From 2ad5a7ce66b0a2cf4164969a2ec20c861eeea30c Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sun, 16 Dec 2012 19:12:53 +0000 Subject: [PATCH] --- src/com/upc/pbe/upcnews/VideoActivity.java | 11 +++++++++++ 1 file changed, 11 insertions(+), 0 deletions(-) diff --git a/src/com/upc/pbe/upcnews/VideoActivity.java b/src/com/upc/pbe/upcnews/VideoActivity.java index 6220025..ce0118d 100644 --- a/src/com/upc/pbe/upcnews/VideoActivity.java +++ b/src/com/upc/pbe/upcnews/VideoActivity.java @@ -20,6 +20,7 @@ import android.net.TrafficStats; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; +import android.view.KeyEvent; import android.view.View; import android.widget.Toast; @@ -200,6 +201,16 @@ public class VideoActivity extends Activity { super.onConfigurationChanged(newConfig); } + public boolean onKeyDown(int keyCode, KeyEvent event) { + // Determina el funcionament al apretar la tecla de tornar enrere + if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { + toggleBuffering(false); + super.finish(); + return true; + } + return super.onKeyDown(keyCode, event); + } + public class DescarregaSegment extends AsyncTask { final static String TAG = "DescarregaSegment"; -- libgit2 0.22.2