JavaScript Events
Listen Android UI Events
Add the following <script>
in the <head>
section of index.html
start()
and stop()
should defined in index.js
<script>
function onEvent(eventType) {
if (eventType == 'OnPlayClick') {
JavaScriptInterface.runScript(`start();`);
} else if (eventType == 'OnPauseClick') {
JavaScriptInterface.runScript('stop();');
}
}
function onLog(message) {
console.log(message);
}
</script>
Event name
OnMenuClick
OnPlayClick
OnPauseClick
OnLogClick
OnSettingClick
OnCloseClick
Last updated