summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/setup
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2015-02-27 17:23:27 -0800
committercretin45 <cretin45@gmail.com>2015-02-27 17:24:32 -0800
commitbce5500e27f3d380563ce886ddcd12672b22b32e (patch)
tree17b3dcdd53a007f7d6f1978328fbec950c98464f /src/com/cyanogenmod/setupwizard/setup
parentec7edd5154408729a30273c4742eb388f6cfe734 (diff)
downloadpackages_apps_SetupWizard-bce5500e27f3d380563ce886ddcd12672b22b32e.zip
packages_apps_SetupWizard-bce5500e27f3d380563ce886ddcd12672b22b32e.tar.gz
packages_apps_SetupWizard-bce5500e27f3d380563ce886ddcd12672b22b32e.tar.bz2
SetupWizard: Make sure fragment is attached in callback
Change-Id: Id492defa4c1d9bcad87311250a5f62fa046ee381
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/CyanogenServicesPage.java12
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java10
2 files changed, 17 insertions, 5 deletions
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) {