|
76 | 76 |
|
77 | 77 | import com.opencsv.CSVWriter; |
78 | 78 |
|
| 79 | +import net.kollnig.missioncontrol.ActivityOnboarding; |
79 | 80 | import net.kollnig.missioncontrol.Common; |
80 | 81 | import net.kollnig.missioncontrol.R; |
81 | 82 | import net.kollnig.missioncontrol.data.Tracker; |
@@ -144,6 +145,15 @@ protected void onCreate(Bundle savedInstanceState) { |
144 | 145 | Log.i(TAG, "Create version=" + Util.getSelfVersionName(this) + "/" + Util.getSelfVersionCode(this)); |
145 | 146 | Util.logExtras(getIntent()); |
146 | 147 |
|
| 148 | + // Check Onboarding |
| 149 | + SharedPreferences prefsOnboarding = PreferenceManager.getDefaultSharedPreferences(this); |
| 150 | + if (!prefsOnboarding.getBoolean("onboarding_complete", false)) { |
| 151 | + super.onCreate(savedInstanceState); |
| 152 | + startActivity(new Intent(this, ActivityOnboarding.class)); |
| 153 | + finish(); |
| 154 | + return; |
| 155 | + } |
| 156 | + |
147 | 157 | // Check minimum Android version |
148 | 158 | if (Build.VERSION.SDK_INT < MIN_SDK) { |
149 | 159 | Log.i(TAG, "SDK=" + Build.VERSION.SDK_INT); |
@@ -513,7 +523,9 @@ public void onConfigurationChanged(Configuration newConfig) { |
513 | 523 | public void onDestroy() { |
514 | 524 | Log.i(TAG, "Destroy"); |
515 | 525 |
|
516 | | - if (Build.VERSION.SDK_INT < MIN_SDK || Util.hasXposed(this) || !Util.canFilter(this)) { |
| 526 | + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
| 527 | + if (Build.VERSION.SDK_INT < MIN_SDK || Util.hasXposed(this) || !Util.canFilter(this) |
| 528 | + || !prefs.getBoolean("onboarding_complete", false)) { |
517 | 529 | super.onDestroy(); |
518 | 530 | return; |
519 | 531 | } |
|
0 commit comments