commit ffcfce742bd0b5f8a29c043be74c466d1e33aacd
Author: Amogh Pradeep <amoghbl1(a)gmail.com>
Date: Sat May 24 02:01:36 2014 +0530
cleaned TipsAndTricks workflow
---
.../torproject/android/wizard/TipsAndTricks.java | 37 ++++++++++++--------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/src/org/torproject/android/wizard/TipsAndTricks.java b/src/org/torproject/android/wizard/TipsAndTricks.java
index 5d0872c..3d2437e 100644
--- a/src/org/torproject/android/wizard/TipsAndTricks.java
+++ b/src/org/torproject/android/wizard/TipsAndTricks.java
@@ -3,25 +3,16 @@ package org.torproject.android.wizard;
import org.torproject.android.Orbot;
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 android.app.Activity;
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
import android.content.Intent;
-import android.content.SharedPreferences;
-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;
-import android.widget.ImageView;
import android.widget.TextView;
public class TipsAndTricks extends Activity implements TorConstants {
@@ -74,6 +65,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View view) {
String url = getString(R.string.gibberbot_apk_url);
+ finish();
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
@@ -86,6 +78,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View view) {
String url = getString(R.string.orweb_apk_url);
+ finish();
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
@@ -98,6 +91,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View view) {
String url = getString(R.string.duckgo_apk_url);
+ finish();
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
@@ -110,6 +104,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View view) {
String url = getString(R.string.proxymob_setup_url);
+ finish();
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
@@ -122,6 +117,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
public void onClick(View view) {
String url = getString(R.string.twitter_setup_url);
+ finish();
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
@@ -148,7 +144,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
back.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
-
+ finish();
startActivityForResult(new Intent(TipsAndTricks.this, Permissions.class), 1);
}
});
@@ -183,19 +179,32 @@ public class TipsAndTricks extends Activity implements TorConstants {
btn1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
+ finish();
startActivityForResult(new Intent(TipsAndTricks.this, Permissions.class), 1);
-
}
});
btn2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
+ finish();
startActivityForResult(new Intent(TipsAndTricks.this, Orbot.class), 1);
-
}
});
}
+
+ //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(), Orbot.class), 1);
+ return true;
+ }
+ return true;
+ }
+
/*
private void showWizardFinal ()
{