Phoneroid website events

In my code, I use webview correctly and handle the onPageFinished and shouldOverrideUrlLoading events. Now I redefined it as DroidGap to handle its functions. Then I have to continue intercepting these events, because if I redefine it, the phone functions no longer work (as on iOS)! How to embed it and handle the described events? thanks

public class webPush extends Activity implements CordovaInterface{ 
+4
source share
2 answers

You do not need to override it in DroidGap. You can use your own implementation with CordovaInterface and just copy the functions you need from the java class of the DroidGap class. This way you can edit existing code or add your own.

This is the official PhoneGap documentation that states:

Change your activity so that it implements the Cordoba surface. It is recommended that you implement the methods that are included. You might want to copy the methods from /framework/src/org/apache/cordova/DroidGap.java, or you can implement your own methods.

Cordova WebView attachment on Android

0
source

Webview embedding we can do this basically

 public class CordovaViewTestActivity extends Activity implements CordovaInterface { CordovaWebView cwv; /* Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); cwv = (CordovaWebView) findViewById(R.id.tutorialView); cwv.loadUrl("file:///android_asset/www/index.html"); } 

If you still get the error, listen to your code along with logcat output. It is easy to solve.

0
source

All Articles