I wish to add a guide in gaia. When someone starts the phone for the first
time, he sees the guide. After some guide pages he will see homescreen.
In gaia, homescreen is started by activity which is created in bootstraps.js
(in system directory). The code are as follows:
function launchHomescreen() {
var activity = new MozActivity({
name: 'view',
data: { type: 'application/x-application-list' }
});
activity.onerror = function homescreenLaunchError() {
console.error('Failed to launch home screen with activity.');
};
}
I add a guide_page app in gaia. In function launchHomescreen(), I replace the
activity so guide_page can handle it.
When the phone starts, the guide_page shows so strange. It looks like the the
guide_page is in the back of other native apps.
Who can tell me how to add a guide page which shows before homescreen? Thanks
in advance.
My code are as follows.
index.html(of guide_page)
*************
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="js/guide_page.js"></script>
</head>
<body>
<h1> Hello World</h1>
</body>
</html>
*************
guide_page.js:
*************
(function() {
if (window.navigator.mozSetMessageHandler) {
window.navigator.mozSetMessageHandler('activity',
function handleActivity(activity) {
var data = activity.source.data;
switch (data.type) {
case 'guide_type':
window.location='index.html';
break;
}
});
}
})();
*************
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g