use of com.eros.framework.activity.AbstractWeexActivity in project WeexErosFramework by bmfe.
the class BMWXApplication method registerLifecycle.
private void registerLifecycle() {
LifecycleManager lifecycleManager = ManagerFactory.getManagerService(LifecycleManager.class);
lifecycleManager.register(this).setOnTaskSwitchListenner(new LifecycleManager.OnTaskSwitchListener() {
@Override
public void onTaskSwitchToForeground() {
Activity activity = RouterTracker.peekActivity();
if (activity != null) {
GlobalEventManager.appActive(((AbstractWeexActivity) activity).getWXSDkInstance());
}
// app resume try check version
if (mVersionChecker != null) {
mVersionChecker.checkVersion();
}
}
@Override
public void onTaskSwitchToBackground() {
Activity activity = RouterTracker.peekActivity();
if (activity != null) {
GlobalEventManager.appDeactive(((AbstractWeexActivity) activity).getWXSDkInstance());
}
}
});
}
Aggregations