How to call a javascript method from python on SL4A?
You'll need to wait for a refresh event (this would be a custom event) in your JavaScript that is waiting for an event posted from your Python script. The only communication layer between JavaScript and Python is via events.
I am writing an Android app using Python and SL4A. The app uses a webview that I wish to refresh. I plan on doing this by utilising javascript location.replace() within a wrapping doRefresh() javascript function. The problem I have is that I do not know how to call the javascript function from within my main event loop within the Python code.
Is there a way to directly call the method?
or
Is there a way to indirectly call the method say via a button's onClick and a mimic screen tap?
Thanks.