Skip to content

Commit 29f2a1d

Browse files
committed
Delaying fetching settings to allow new screen to load immediately
1 parent 5592667 commit 29f2a1d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import android.content.Intent;
1111
import android.content.res.Resources;
1212
import android.os.Bundle;
13+
import android.os.Handler;
1314
import android.preference.EditTextPreference;
1415
import android.preference.Preference;
1516
import android.preference.PreferenceCategory;
@@ -213,10 +214,15 @@ public void onPause() {
213214
public void onResume() {
214215
super.onResume();
215216

216-
// initialize settings with locally cached values, fetch remote on first pass
217-
mSiteSettings.init(mShouldFetch);
218-
// stop future calls from fetching remote settings
219-
mShouldFetch = false;
217+
new Handler().postDelayed(new Runnable() {
218+
@Override
219+
public void run() {
220+
// initialize settings with locally cached values, fetch remote on first pass
221+
mSiteSettings.init(mShouldFetch);
222+
// stop future calls from fetching remote settings
223+
mShouldFetch = false;
224+
}
225+
}, 1000);
220226
}
221227

222228
@Override

0 commit comments

Comments
 (0)