always show MainActivity after first-time CreateKeyActivity
This commit is contained in:
parent
01e68e044c
commit
94683607d6
|
@ -32,6 +32,7 @@ import org.sufficientlysecure.keychain.ui.base.BaseNfcActivity;
|
|||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||
import org.sufficientlysecure.keychain.ui.util.Notify;
|
||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||
import org.sufficientlysecure.keychain.util.Preferences;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -262,8 +263,19 @@ public class CreateKeyActivity extends BaseNfcActivity {
|
|||
}
|
||||
|
||||
interface NfcListenerFragment {
|
||||
public void doNfcInBackground() throws IOException;
|
||||
public void onNfcPostExecute() throws IOException;
|
||||
void doNfcInBackground() 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() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
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
|
||||
if (!mCreateKeyActivity.mFirstTime) {
|
||||
mCreateKeyActivity.setResult(Activity.RESULT_CANCELED);
|
||||
mCreateKeyActivity.finish();
|
||||
}
|
||||
mCreateKeyActivity.finish();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -124,9 +117,6 @@ public class CreateKeyStartFragment extends Fragment {
|
|||
if (mCreateKeyActivity.mFirstTime) {
|
||||
Preferences prefs = Preferences.getPreferences(mCreateKeyActivity);
|
||||
prefs.setFirstTime(false);
|
||||
Intent intent = new Intent(mCreateKeyActivity, MainActivity.class);
|
||||
intent.putExtras(data);
|
||||
startActivity(intent);
|
||||
mCreateKeyActivity.finish();
|
||||
} else {
|
||||
// just finish activity and return data
|
||||
|
|
Loading…
Reference in a new issue