always show MainActivity after first-time CreateKeyActivity
This commit is contained in:
@@ -32,6 +32,7 @@ import org.sufficientlysecure.keychain.ui.base.BaseNfcActivity;
|
|||||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||||
import org.sufficientlysecure.keychain.ui.util.Notify;
|
import org.sufficientlysecure.keychain.ui.util.Notify;
|
||||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||||
|
import org.sufficientlysecure.keychain.util.Preferences;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -262,8 +263,19 @@ public class CreateKeyActivity extends BaseNfcActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface NfcListenerFragment {
|
interface NfcListenerFragment {
|
||||||
public void doNfcInBackground() throws IOException;
|
void doNfcInBackground() throws IOException;
|
||||||
public void onNfcPostExecute() throws IOException;
|
void onNfcPostExecute() throws IOException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish() {
|
||||||
|
if (mFirstTime) {
|
||||||
|
Preferences prefs = Preferences.getPreferences(this);
|
||||||
|
prefs.setFirstTime(false);
|
||||||
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,17 +98,10 @@ public class CreateKeyStartFragment extends Fragment {
|
|||||||
mSkipOrCancel.setOnClickListener(new View.OnClickListener() {
|
mSkipOrCancel.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (mCreateKeyActivity.mFirstTime) {
|
if (!mCreateKeyActivity.mFirstTime) {
|
||||||
Preferences prefs = Preferences.getPreferences(mCreateKeyActivity);
|
|
||||||
prefs.setFirstTime(false);
|
|
||||||
Intent intent = new Intent(mCreateKeyActivity, MainActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
mCreateKeyActivity.finish();
|
|
||||||
} else {
|
|
||||||
// just finish activity and return data
|
|
||||||
mCreateKeyActivity.setResult(Activity.RESULT_CANCELED);
|
mCreateKeyActivity.setResult(Activity.RESULT_CANCELED);
|
||||||
mCreateKeyActivity.finish();
|
|
||||||
}
|
}
|
||||||
|
mCreateKeyActivity.finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -124,9 +117,6 @@ public class CreateKeyStartFragment extends Fragment {
|
|||||||
if (mCreateKeyActivity.mFirstTime) {
|
if (mCreateKeyActivity.mFirstTime) {
|
||||||
Preferences prefs = Preferences.getPreferences(mCreateKeyActivity);
|
Preferences prefs = Preferences.getPreferences(mCreateKeyActivity);
|
||||||
prefs.setFirstTime(false);
|
prefs.setFirstTime(false);
|
||||||
Intent intent = new Intent(mCreateKeyActivity, MainActivity.class);
|
|
||||||
intent.putExtras(data);
|
|
||||||
startActivity(intent);
|
|
||||||
mCreateKeyActivity.finish();
|
mCreateKeyActivity.finish();
|
||||||
} else {
|
} else {
|
||||||
// just finish activity and return data
|
// just finish activity and return data
|
||||||
|
|||||||
Reference in New Issue
Block a user