K
K
kopytse2018-06-06 15:15:53
Android
kopytse, 2018-06-06 15:15:53

How to add event handling to View?

The bottom line is this: I create a WebView component in an Android application using the code:

protected WebView createViewInstance(ThemedReactContext reactContext) {
        WebView view = super.createViewInstance(reactContext);	
        final AndroidWebViewModule module = this.aPackage.getModule();
        view.setWebChromeClient(new WebChromeClient(){
                ...
        });
        return view;
    }

I don't understand Java at all, so I'm asking for help with the following question: how to attach an event handling to which this View should respond to a View associated with a WebView ? I need an event like this:
protected void onWindowVisibilityChanged(visibility) {
    if (visibility != View.GONE) super.onWindowVisibilityChanged(visibility);
  }

In other words, when the application is minimized, an event should be fired that simulates the continuation of the "active" state of the application.
Thank you in advance for your response.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question