Search code examples
javaandroidlayoutibm-mobilefirstsetcontentview

how to call native Activity class from html page in MobileFirst hybrid application


Hi I am creating a MobileFirst Hybrid application and need to launch/call Activity class onCreate() method on index.html page load.


Solution

  • So here is what I did,

    Inherited CordovaActivity class instead of Activity class and implemented WLInitWebFrameworkListener. In onInitWebFrameworkComplete event added:

    super.loadUrl(WL.getInstance().getMainHtmlFilePath());
    

    Under Oncreate() method added

    WL.createInstance(this);
    WL.getInstance().initializeWebFramework(getApplicationContext(), this);
    

    and now my SendActionAPI works