I just noticed a logical error which I would try to describe.
If the user opens the app for the first time (fresh installation) and rotates his/her phone while at set up screen, the user is taken to the MainActivity without providing details. This is caused by these lines of code which i have corrected:
Logical error
@Override
protected void onResume() {
super.onResume();
if (mSharedPreferenceStore.mPrefsStore.getBoolean("com.peacecorps.malaria.isFirstRun",
true)) { // false sould be passed instead of true
mSharedPreferenceStore.mEditor.putBoolean(
"com.peacecorps.malaria.hasUserSetPreference", true).commit();
}
}
@Override
protected void onPause() {
super.onPause();
if (mSharedPreferenceStore.mPrefsStore.getBoolean("com.peacecorps.malaria.isFirstRun",
true)) { // false should be passed instead of true
mSharedPreferenceStore.mEditor.putBoolean(
"com.peacecorps.malaria.hasUserSetPreference", true).commit();
}
}
Also to make sure that the user is not taken to set up screen, this line of code should be added in
saveUserTimeAndMedicationPrefs()
mSharedPreferenceStore.mEditor.putBoolean(
"com.peacecorps.malaria.hasUserSetPreference", true).commit();