cleaned Permissions workflow, implemented override for back button
This commit is contained in:
parent
935fa91199
commit
6488e6a699
|
@ -3,7 +3,6 @@ package org.torproject.android.wizard;
|
|||
import org.sufficientlysecure.rootcommands.RootCommands;
|
||||
import org.torproject.android.R;
|
||||
import org.torproject.android.TorConstants;
|
||||
import org.torproject.android.service.TorService;
|
||||
import org.torproject.android.service.TorServiceUtils;
|
||||
|
||||
import android.app.Activity;
|
||||
|
@ -12,14 +11,13 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class Permissions extends Activity implements TorConstants {
|
||||
|
@ -138,9 +136,8 @@ public class Permissions extends Activity implements TorConstants {
|
|||
}
|
||||
else
|
||||
{
|
||||
finish();
|
||||
startActivityForResult(new Intent(Permissions.this, ConfigureTransProxy.class), 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -150,7 +147,7 @@ public class Permissions extends Activity implements TorConstants {
|
|||
back.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
|
||||
finish();
|
||||
startActivityForResult(new Intent(Permissions.this, LotsaText.class), 1);
|
||||
}
|
||||
});
|
||||
|
@ -160,6 +157,7 @@ public class Permissions extends Activity implements TorConstants {
|
|||
|
||||
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
startActivityForResult(new Intent(Permissions.this, TipsAndTricks.class), 1);
|
||||
}
|
||||
});
|
||||
|
@ -193,7 +191,7 @@ public class Permissions extends Activity implements TorConstants {
|
|||
btn1.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
|
||||
finish();
|
||||
startActivityForResult(new Intent(Permissions.this, LotsaText.class), 1);
|
||||
}
|
||||
});
|
||||
|
@ -201,10 +199,21 @@ public class Permissions extends Activity implements TorConstants {
|
|||
btn2.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
startActivityForResult(new Intent(Permissions.this, TipsAndTricks.class), 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Code to override the back button!
|
||||
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(), LotsaText.class), 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue