diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenServicesPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenServicesPage.java index 7db6eca..6d9e149 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CyanogenServicesPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenServicesPage.java @@ -127,9 +127,15 @@ public class CyanogenServicesPage extends SetupPage { ActivityOptions.makeCustomAnimation(mContext, android.R.anim.fade_in, android.R.anim.fade_out); - mFragment.startActivityForResult(intent, - SetupWizardApp.REQUEST_CODE_SETUP_CYANOGEN, - options.toBundle()); + if (!mFragment.isDetached()) { + mFragment.startActivityForResult(intent, + SetupWizardApp.REQUEST_CODE_SETUP_CYANOGEN, + options.toBundle()); + } else { + if (getCallbacks().isCurrentPage(CyanogenServicesPage.this)) { + getCallbacks().onNextPage(); + } + } } catch (OperationCanceledException e) { } catch (IOException e) { } catch (AuthenticatorException e) { diff --git a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java index 20f25c1..a897db0 100644 --- a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java @@ -203,8 +203,14 @@ public class GmsAccountPage extends SetupPage { ActivityOptions.makeCustomAnimation(mContext, android.R.anim.fade_in, android.R.anim.fade_out); - mFragment.startActivityForResult(intent, - SetupWizardApp.REQUEST_CODE_SETUP_GMS, options.toBundle()); + if (!mFragment.isDetached()) { + mFragment.startActivityForResult(intent, + SetupWizardApp.REQUEST_CODE_SETUP_GMS, options.toBundle()); + } else { + if (getCallbacks().isCurrentPage(GmsAccountPage.this)) { + getCallbacks().onNextPage(); + } + } } catch (OperationCanceledException e) { } catch (IOException e) { } catch (AuthenticatorException e) {