mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-23 04:41:16 +00:00
Don't load folders/devices in onResume()
This commit is contained in:
parent
87f36fcf13
commit
b1af659e79
2 changed files with 16 additions and 28 deletions
|
@ -35,19 +35,6 @@ public class DeviceListFragment extends ListFragment implements SyncthingService
|
|||
|
||||
private Timer mTimer;
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mTimer = new Timer();
|
||||
mTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
getActivity().runOnUiThread(DeviceListFragment.this::updateList);
|
||||
}
|
||||
|
||||
}, 0, SyncthingService.GUI_UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
@ -59,7 +46,14 @@ public class DeviceListFragment extends ListFragment implements SyncthingService
|
|||
if (currentState != SyncthingService.State.ACTIVE)
|
||||
return;
|
||||
|
||||
updateList();
|
||||
mTimer = new Timer();
|
||||
mTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
getActivity().runOnUiThread(DeviceListFragment.this::updateList);
|
||||
}
|
||||
|
||||
}, 0, SyncthingService.GUI_UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,19 +43,6 @@ public class FolderListFragment extends ListFragment implements SyncthingService
|
|||
|
||||
private Timer mTimer;
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mTimer = new Timer();
|
||||
mTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
getActivity().runOnUiThread(FolderListFragment.this::updateList);
|
||||
}
|
||||
|
||||
}, 0, SyncthingService.GUI_UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
@ -67,7 +54,14 @@ public class FolderListFragment extends ListFragment implements SyncthingService
|
|||
if (currentState != SyncthingService.State.ACTIVE)
|
||||
return;
|
||||
|
||||
updateList();
|
||||
mTimer = new Timer();
|
||||
mTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
getActivity().runOnUiThread(FolderListFragment.this::updateList);
|
||||
}
|
||||
|
||||
}, 0, SyncthingService.GUI_UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue