cleaned LotsaText workflow, implemented override for back button

This commit is contained in:
Amogh Pradeep 2014-05-24 02:43:28 +05:30
parent f29a49439e
commit 935fa91199
1 changed files with 13 additions and 8 deletions

View File

@ -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;
}
}