IBM Worklight v5.0.5 > Develop IBM Worklight applications > Development guidelines for mobile environments > Web and native code in iPhone, iPad, and AndroidReturn control to the web view from a Java page
Implement the page as an Activity object or extend an Activity. Declare the activity in AndroidManifest.xml.
In the native page, call the finish() function of the Activity. Pass data back to the web view by creating an Intent object.
// Pass data and control to the web view Intent gameInfo = new Intent (); gameInfo.putExtra("winnerScore", winnerScore); gameInfo.putExtra("winnerName", winnerName); setResult(RESULT_OK, gameInfo); finish(); // Receive the data in the web view this.callback = function(data){$('resultDiv').update('The winner is: ' + data.winnerName + " with score: " + data.winnerScore);};
Parent Web and native code in iPhone, iPad, and Android