How detect launch application event from main-page.js



var application = require(“application”);
moduleName: “main-page”
application.on(application.launchEvent, function (args) {
if ( {
// For Android applications, is an android.content.Intent class.
console.log("Launched Android application with the following intent: " + + “.”);
} ;

this code when i run on app.js is detect the Launch event but from main-page.js is not working


I believe the application events should be specified before application.start. See here:

Since the main page loads AFTER the app is initialized, I’m guessing that’s why it doesn’t work.


i find solution by importing my functions from main-page.js to app.js