Java – Android phonegap cordova webview event

Android phonegap cordova webview event… here is a solution to the problem.

Android phonegap cordova webview event

In my code, I used webview correctly and handled the onPageFinished and shouldOverrideUrlLoading events. Now I’m redefining it as DroidGap in order to handle its functionality. Then I should continue to intercept these events, because if I override it, the phonegap function will no longer execute (as I did on iOS)! Thanks

public class webPush extends Activity implements CordovaInterface{

Solution

You don’t need to redefine it as DroidGap. You can use CordovaInterface with your own implementation, just copy the functionality you need from the DroidGap java class. This allows you to edit existing code or add your own.

Here’s what the official PhoneGap documentation says:

Modify your activity so that it implements the CordovaInterface. It is recommended that you implement the methods that are included. You may wish to copy the methods from /framework/src/org/apache/cordova/DroidGap.java, or you may wish to implement your own methods

Embedding Cordova WebView on Android

Related Problems and Solutions