Android - Using native pages
OverviewIn this tutorial, integration of native and web "pages" in an Android application will be explained by using the
WL.NativePage.show()needs to be implemented in order to open the native page:
nativePageClassName: The name of a native Android Activity to start.
backFromNativePage: A callback function to call when the native page closes.
params: optional custom parameters object to pass to the native code.
backFromNativePage(data): After the native closes, it can pass data back to the web part of an application.
Creating a native pageIn Android, the native page must be implemented as an Android Activity, or extend an existing Activity. Step 1 As with any Activity, it must be declared in the
AndroidManifest.xmlfile. For example: Step 2 To retrieve custom data parameters that are passed from the web view, an
intentshould be used:
Returning control to the web viewWhen the native page switches back to the web view, the
finish()function is called for the Activity. To pass data back to the web view can be done by using an
Sample applicationClick to download the Studio project. ▲
Last modified on November 09, 2016