[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] cleaned ConfigureTransProxy workflow, implemented override for back button



commit f29a49439e9c0a0dbcde7f4dc524d54c7be7821f
Author: Amogh Pradeep <amoghbl1@xxxxxxxxx>
Date:   Sat May 24 02:38:19 2014 +0530

    cleaned ConfigureTransProxy workflow, implemented override for back button
---
 .../android/wizard/ConfigureTransProxy.java        |   26 ++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/org/torproject/android/wizard/ConfigureTransProxy.java b/src/org/torproject/android/wizard/ConfigureTransProxy.java
index abbaee6..487d0a1 100644
--- a/src/org/torproject/android/wizard/ConfigureTransProxy.java
+++ b/src/org/torproject/android/wizard/ConfigureTransProxy.java
@@ -20,6 +20,8 @@ import android.content.SharedPreferences.Editor;
 import android.net.Uri;
 import android.os.Bundle;
 import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.KeyEvent;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
@@ -119,7 +121,7 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
 		    back.setOnClickListener(new View.OnClickListener() {
 					
 				public void onClick(View v) {
-						
+					finish();	
 					startActivityForResult(new Intent(ConfigureTransProxy.this, Permissions.class), 1);
 				}
 			});
@@ -127,7 +129,7 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
 		    next.setOnClickListener(new View.OnClickListener() {
 				
 				public void onClick(View v) {
-					
+					finish();
 					startActivityForResult(new Intent(ConfigureTransProxy.this, TipsAndTricks.class), 1);
 
 				}
@@ -142,11 +144,8 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
     		{
 
 				public void onClick(View v) {
-					
-						context.startActivity(new Intent(context, AppManager.class));							
-					
-					
-					
+					finish();
+					context.startActivity(new Intent(context, AppManager.class));
 				}
     			
     		});
@@ -239,4 +238,17 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
 		super.onSaveInstanceState(outState);
 		
 	}
+	
+	//Code to override the back button!
+	@Override
+	public boolean onKeyDown(int keyCode, KeyEvent event)  {
+		Log.d("myTag", "IT HAS BEEN CLICKED :O"+keyCode+"    "+event);
+	    if(keyCode == KeyEvent.KEYCODE_BACK){
+	    	finish();
+	    	startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1);
+	    	return true;
+	    }
+	    return false;
+	}
+		
 }
\ No newline at end of file



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits