1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-27 06:41:15 +00:00

Merge branch 'Zillode-fix-npe-getversion'

This commit is contained in:
Felix Ableitner 2015-03-23 23:22:22 +01:00
commit 4bcfeecf3a

View file

@ -54,11 +54,10 @@ public class SettingsFragment extends PreferenceFragment
mOptionsScreen.setEnabled(currentState == SyncthingService.State.ACTIVE); mOptionsScreen.setEnabled(currentState == SyncthingService.State.ACTIVE);
mGuiScreen.setEnabled(currentState == SyncthingService.State.ACTIVE); mGuiScreen.setEnabled(currentState == SyncthingService.State.ACTIVE);
if (currentState == SyncthingService.State.ACTIVE) {
Preference syncthingVersion = getPreferenceScreen().findPreference(SYNCTHING_VERSION_KEY); Preference syncthingVersion = getPreferenceScreen().findPreference(SYNCTHING_VERSION_KEY);
syncthingVersion.setSummary(mSyncthingService.getApi().getVersion()); syncthingVersion.setSummary(mSyncthingService.getApi().getVersion());
RestApi api = mSyncthingService.getApi(); RestApi api = mSyncthingService.getApi();
if (currentState == SyncthingService.State.ACTIVE) {
for (int i = 0; i < mOptionsScreen.getPreferenceCount(); i++) { for (int i = 0; i < mOptionsScreen.getPreferenceCount(); i++) {
final Preference pref = mOptionsScreen.getPreference(i); final Preference pref = mOptionsScreen.getPreference(i);
pref.setOnPreferenceChangeListener(SettingsFragment.this); pref.setOnPreferenceChangeListener(SettingsFragment.this);