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

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



commit 935fa911992c0082b1567b0276b88e650770829e
Author: Amogh Pradeep <amoghbl1@xxxxxxxxx>
Date:   Sat May 24 02:43:28 2014 +0530

    cleaned LotsaText workflow, implemented override for back button
---
 src/org/torproject/android/wizard/LotsaText.java |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/org/torproject/android/wizard/LotsaText.java b/src/org/torproject/android/wizard/LotsaText.java
index 3568779..9e28024 100644
--- a/src/org/torproject/android/wizard/LotsaText.java
+++ b/src/org/torproject/android/wizard/LotsaText.java
@@ -2,10 +2,6 @@ package org.torproject.android.wizard;
 
 import org.torproject.android.R;
 import org.torproject.android.TorConstants;
-import org.torproject.android.R.drawable;
-import org.torproject.android.R.id;
-import org.torproject.android.R.layout;
-import org.torproject.android.R.string;
 import org.torproject.android.service.TorServiceUtils;
 
 import android.app.Activity;
@@ -14,11 +10,9 @@ import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.Editor;
 import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.support.v4.app.ActivityCompat;
+import android.view.KeyEvent;
 import android.view.View;
 import android.widget.Button;
-import android.widget.ImageView;
 import android.widget.TextView;
 
 public class LotsaText extends Activity implements TorConstants{
@@ -135,11 +129,22 @@ public class LotsaText extends Activity implements TorConstants{
     	btn2.setOnClickListener(new View.OnClickListener() {
 			
 			public void onClick(View v) {
+				finish();
 				startActivityForResult(new Intent(LotsaText.this, Permissions.class), 1);
 			}
 		});
 		
 	}
-
+	
+	//Code to override the back button!
+	@Override
+	public boolean onKeyDown(int keyCode, KeyEvent event)  {
+	    if(keyCode == KeyEvent.KEYCODE_BACK){
+	    	finish();
+	    	startActivityForResult(new Intent(getBaseContext(), ChooseLocaleWizardActivity.class), 1);
+	    	return true;
+	    }
+	    return true;
+	}
 	
 }
\ No newline at end of file



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