Search in sources :

Example 6 with WXException

use of com.taobao.weex.common.WXException in project weex-example by KalicyZhou.

the class WXApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    //    initDebugEnvironment(true, false, "DEBUG_SERVER_HOST");
    //    WXSDKEngine.addCustomOptions("appName", "WXSample");
    //    WXSDKEngine.addCustomOptions("appGroup", "WXApp");
    WXSDKEngine.initialize(this, new InitConfig.Builder().setImgAdapter(new ImageAdapter()).setURIAdapter(new CustomURIAdapter()).build());
    try {
        WXSDKEngine.registerModule("event", WXEventModule.class);
        WXSDKEngine.registerModule("service", WXServiceModule.class);
    } catch (WXException e) {
        e.printStackTrace();
    }
    Fresco.initialize(this);
    AppConfig.init(this);
    PluginManager.init(this);
}
Also used : CustomURIAdapter(com.alibaba.weex.commons.adapter.CustomURIAdapter) ImageAdapter(com.alibaba.weex.commons.adapter.ImageAdapter) WXException(com.taobao.weex.common.WXException)

Example 7 with WXException

use of com.taobao.weex.common.WXException in project JustAndroid by chinaltz.

the class MyApplication method initWeexConfig.

private void initWeexConfig() {
    WXSDKEngine.initialize(this, new InitConfig.Builder().setHttpAdapter(new BingoWXHttpAdapter()).setImgAdapter(new ImageAdapter()).setDebugAdapter(new PlayDebugAdapter()).setJSExceptionAdapter(new JSExceptionAdapter()).build());
    try {
        WXSDKEngine.registerModule("myModule", WXEventModule.class);
    } catch (WXException e) {
        e.printStackTrace();
    }
    registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {

        @Override
        public void onActivityCreated(Activity activity, Bundle bundle) {
        }

        @Override
        public void onActivityStarted(Activity activity) {
        }

        @Override
        public void onActivityResumed(Activity activity) {
        }

        @Override
        public void onActivityPaused(Activity activity) {
        }

        @Override
        public void onActivityStopped(Activity activity) {
        }

        @Override
        public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
        }

        @Override
        public void onActivityDestroyed(Activity activity) {
            // The demo code of calling 'notifyTrimMemory()'
            if (false) {
                // We assume that the application is on an idle time.
                WXSDKManager.getInstance().notifyTrimMemory();
            }
        }
    });
}
Also used : BingoWXHttpAdapter(com.litingzhe.justandroid.someOther.weex.weexAdapter.BingoWXHttpAdapter) JSExceptionAdapter(com.litingzhe.justandroid.someOther.weex.weexAdapter.JSExceptionAdapter) ImageAdapter(com.litingzhe.justandroid.someOther.weex.weexAdapter.ImageAdapter) Bundle(android.os.Bundle) WXException(com.taobao.weex.common.WXException) Activity(android.app.Activity) PlayDebugAdapter(com.litingzhe.justandroid.someOther.weex.weexAdapter.PlayDebugAdapter)

Aggregations

WXException (com.taobao.weex.common.WXException)7 Activity (android.app.Activity)3 Bundle (android.os.Bundle)3 ImageAdapter (com.alibaba.weex.commons.adapter.ImageAdapter)3 SimpleComponentHolder (com.taobao.weex.ui.SimpleComponentHolder)3 DefaultWebSocketAdapterFactory (com.alibaba.weex.commons.adapter.DefaultWebSocketAdapterFactory)2 JSExceptionAdapter (com.alibaba.weex.commons.adapter.JSExceptionAdapter)2 WXDiv (com.taobao.weex.ui.component.WXDiv)2 WXImage (com.taobao.weex.ui.component.WXImage)2 WXIndicator (com.taobao.weex.ui.component.WXIndicator)2 WXScroller (com.taobao.weex.ui.component.WXScroller)2 WXSlider (com.taobao.weex.ui.component.WXSlider)2 WXSliderNeighbor (com.taobao.weex.ui.component.WXSliderNeighbor)2 WXText (com.taobao.weex.ui.component.WXText)2 BatchOperationHelper (com.taobao.weex.utils.batch.BatchOperationHelper)2 CustomURIAdapter (com.alibaba.weex.commons.adapter.CustomURIAdapter)1 PlayDebugAdapter (com.alibaba.weex.extend.PlayDebugAdapter)1 DefaultAccessibilityRoleAdapter (com.alibaba.weex.extend.adapter.DefaultAccessibilityRoleAdapter)1 InterceptWXHttpAdapter (com.alibaba.weex.extend.adapter.InterceptWXHttpAdapter)1 HookImage (com.eros.framework.extend.hook.ui.components.HookImage)1