hello, i need help with extension development. I will try something with webview. but I don’t know how to do event handler. For example, how can we listen to the pageloaded event. From the documentation we can see that it’s like a void function.
Events in App Inventor are no different than your regular Java methods other than that they are annotated with @SimpleEvent. To invoke an event, you just need to call the method that represents that event. Here’s an example:
You define your events like this:
@SimpleEvent
public void CalculationDone(int result) {
EventDispatcher.dispatchEvent(this, "CalculationDone", result);
}
And this is how you invoke them:
@SimpleFunction
public void Calculate(List numbers) {
final int result = /** perform some intense calculation here */;
CalculationDone(result);
}