Skip to content

Commit

Permalink
App crashes when the user tries to open Admin Settings if targetSdk…
Browse files Browse the repository at this point in the history
…Version is set to 24 (getodk#2533)



* Bump targetSdkVersion to 24
  • Loading branch information
grzesiek2010 authored and shobhitagarwal1612 committed Oct 4, 2018
1 parent 1c9407e commit c8aa02b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion collect_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ android {
defaultConfig {
applicationId('org.odk.collect.android')
minSdkVersion(16)
targetSdkVersion(23)
targetSdkVersion(24)
versionCode LEGACY_BUILD_NUMBER_OFFSET + getMasterCommitCount()
versionName getVersionName()
testInstrumentationRunner('android.support.test.runner.AndroidJUnitRunner')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.text.InputType;
import android.view.LayoutInflater;
Expand All @@ -39,7 +38,6 @@
import org.odk.collect.android.utilities.ToastUtils;

import static android.content.Context.MODE_PRIVATE;
import static android.content.Context.MODE_WORLD_READABLE;
import static org.odk.collect.android.fragments.dialogs.MovingBackwardsDialog.MOVING_BACKWARDS_DIALOG_TAG;
import static org.odk.collect.android.preferences.AdminKeys.KEY_ADMIN_PW;
import static org.odk.collect.android.preferences.AdminKeys.KEY_CHANGE_ADMIN_PASSWORD;
Expand All @@ -58,9 +56,7 @@ public class AdminPreferencesFragment extends BasePreferenceFragment implements
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferenceManager prefMgr = getPreferenceManager();
prefMgr.setSharedPreferencesName(ADMIN_PREFERENCES);
prefMgr.setSharedPreferencesMode(MODE_WORLD_READABLE);
getPreferenceManager().setSharedPreferencesName(ADMIN_PREFERENCES);

addPreferencesFromResource(R.xml.admin_preferences);

Expand Down Expand Up @@ -173,9 +169,7 @@ public static class MainMenuAccessPreferences extends BasePreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferenceManager prefMgr = getPreferenceManager();
prefMgr.setSharedPreferencesName(ADMIN_PREFERENCES);
prefMgr.setSharedPreferencesMode(MODE_WORLD_READABLE);
getPreferenceManager().setSharedPreferencesName(ADMIN_PREFERENCES);

addPreferencesFromResource(R.xml.main_menu_access_preferences);
findPreference(KEY_EDIT_SAVED).setEnabled((Boolean) AdminSharedPreferences.getInstance().get(ALLOW_OTHER_WAYS_OF_EDITING_FORM));
Expand All @@ -201,9 +195,7 @@ public static class UserSettingsAccessPreferences extends BasePreferenceFragment
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferenceManager prefMgr = getPreferenceManager();
prefMgr.setSharedPreferencesName(ADMIN_PREFERENCES);
prefMgr.setSharedPreferencesMode(MODE_WORLD_READABLE);
getPreferenceManager().setSharedPreferencesName(ADMIN_PREFERENCES);

addPreferencesFromResource(R.xml.user_settings_access_preferences);
}
Expand All @@ -227,9 +219,7 @@ public static class FormEntryAccessPreferences extends BasePreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferenceManager prefMgr = getPreferenceManager();
prefMgr.setSharedPreferencesName(ADMIN_PREFERENCES);
prefMgr.setSharedPreferencesMode(MODE_WORLD_READABLE);
getPreferenceManager().setSharedPreferencesName(ADMIN_PREFERENCES);

addPreferencesFromResource(R.xml.form_entry_access_preferences);

Expand Down

0 comments on commit c8aa02b

Please sign in to comment.