Commit df48ecd9 by sikang

UPDATE

parent 7897ed5e
......@@ -2,17 +2,13 @@ package tech.starwin.utils;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.appsflyer.AppsFlyerLib;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import tech.starwin.LibConfig;
......@@ -77,17 +73,17 @@ public class TrackEventHelper {
*/
private static final int CACHE_EXPIRATION_SECONDS = 60 * 5;//remoteConfig 刷新频率
public static void fetchRemoteConfig() {
final FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
config.fetch(CACHE_EXPIRATION_SECONDS)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
config.activateFetched();
}
}
});
}
// public static void fetchRemoteConfig() {
// final FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
// config.fetch(CACHE_EXPIRATION_SECONDS)
// .addOnCompleteListener(new OnCompleteListener<Void>() {
// @Override
// public void onComplete(@NonNull Task<Void> task) {
// if (task.isSuccessful()) {
// config.activateFetched();
// }
// }
// });
// }
}
......@@ -11,6 +11,7 @@ import java.util.HashMap;
import java.util.Map;
import tech.starwin.utils.GeneralUtils;
import tech.starwin.utils.LogUtils;
/**
......@@ -18,6 +19,7 @@ import tech.starwin.utils.GeneralUtils;
* Fragment的启动管理
*/
public class FragmentLauncher {
public static final String TAG = "FragmentLauncher";
private FragmentActivity activity;
/**
......@@ -110,8 +112,12 @@ public class FragmentLauncher {
//更新当前页
currentFragment = fragment;
if (arguments != null) {
fragment.setArguments(arguments);
try {
if (arguments != null) {
fragment.setArguments(arguments);
}
} catch (IllegalStateException e) {
LogUtils.d(TAG, e.getMessage());
}
if (listener != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment