mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-27 13:21:30 +00:00
Only access the version information when the SyncthingService is active (fixes #292).
This commit is contained in:
parent
3558060fe0
commit
d73b430cf8
1 changed files with 3 additions and 4 deletions
|
@ -54,11 +54,10 @@ public class SettingsFragment extends PreferenceFragment
|
|||
mOptionsScreen.setEnabled(currentState == SyncthingService.State.ACTIVE);
|
||||
mGuiScreen.setEnabled(currentState == SyncthingService.State.ACTIVE);
|
||||
|
||||
Preference syncthingVersion = getPreferenceScreen().findPreference(SYNCTHING_VERSION_KEY);
|
||||
syncthingVersion.setSummary(mSyncthingService.getApi().getVersion());
|
||||
RestApi api = mSyncthingService.getApi();
|
||||
|
||||
if (currentState == SyncthingService.State.ACTIVE) {
|
||||
Preference syncthingVersion = getPreferenceScreen().findPreference(SYNCTHING_VERSION_KEY);
|
||||
syncthingVersion.setSummary(mSyncthingService.getApi().getVersion());
|
||||
RestApi api = mSyncthingService.getApi();
|
||||
for (int i = 0; i < mOptionsScreen.getPreferenceCount(); i++) {
|
||||
final Preference pref = mOptionsScreen.getPreference(i);
|
||||
pref.setOnPreferenceChangeListener(SettingsFragment.this);
|
||||
|
|
Loading…
Reference in a new issue