Slide 22
Slide 22 text
private void fetch() {
long cacheExpiration = 3600;
if (remoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled()) {
cacheExpiration = 0;
}
remoteConfig.fetch(cacheExpiration)
.addOnSuccessListener(aVoid -> {
Log.d(TAG, "Fetch succeeded.");
remoteConfig.activateFetched();
String colorName = remoteConfig.getString("color");
container.setBackgroundColor(Color.parseColor(colorName));
})
.addOnFailureListener(e -> Log.e(TAG, "Fetch failed.", e));
}