From 935fa911992c0082b1567b0276b88e650770829e Mon Sep 17 00:00:00 2001 From: Amogh Pradeep Date: Sat, 24 May 2014 02:43:28 +0530 Subject: [PATCH] cleaned LotsaText workflow, implemented override for back button --- .../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 3568779d..9e280242 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