can any one explain what is the difference between below code blocks to load url.
in second code i have defined cordova webview on activity.xml
import org.apache.cordova.*;
public class HelloWorld extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
super.loadUrl("file:///android_asset/www/index.html");
}
}
vs
public class MyActivity extends CordovaActivity
{
CordovaWebView mainView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
setContentView(R.layout.activity_my);
mainView = (CordovaWebView) findViewById(R.id.mainView);
Config.init(this);
mainView.addJavascriptInterface(this, "JSInterface");
mainView.loadUrl("file:///android_asset/www/Index.html" );
}
}
Actually i wants to use JavascriptInterface to call some native functions from javascript the same javascript interface how can i use while loading using super.loadurl.