Search in sources :

Example 6 with AbstractWeexActivity

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());
            }
        }
    });
}
Also used : LifecycleManager(com.eros.framework.manager.impl.LifecycleManager) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) Activity(android.app.Activity) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity)

Aggregations

AbstractWeexActivity (com.eros.framework.activity.AbstractWeexActivity)6 Activity (android.app.Activity)4 ParseManager (com.eros.framework.manager.impl.ParseManager)3 RouterModel (com.eros.framework.model.RouterModel)2 Context (android.content.Context)1 LifecycleManager (com.eros.framework.manager.impl.LifecycleManager)1 NatigatorModel (com.eros.framework.model.NatigatorModel)1 WXSDKInstance (com.taobao.weex.WXSDKInstance)1 JSMethod (com.taobao.weex.annotation.JSMethod)1 Map (java.util.Map)1