I have a problem. Currently, I have edited my CordovaWebView.java class, so when I click the device return button, the application will be asked to close.
public boolean backHistory() { // Check webview first to see if there is a history // This is needed to support curPage#diffLink, since they are added to appView history, but not our history url array (JQMobile behavior) if (super.canGoBack()) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("Sign out Confirm") .setMessage("Are you sure you want to logout?") .setCancelable(false) .setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { cordova.getActivity().finish(); } }) .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }).show(); // super.goBack(); return true; } return false; }
So, when I open a new web page from my application, it just opens the web page inside my application itself. Therefore, I do not have the opportunity to return after I go to my web page, because the application will be asked to close due to changes that I made.
Is there a way to open a webpage in a device browser. Or I can do additional editing to return when the web page opens.
I tried opening these methods in the deviceβs browser, but it didnβt work.
var url = $state.href('myroute', {parameter: "parameter"}); window.open("https://www.google.lk/",'_system'); window.open('http://www.myurl.nl', '_system', 'location=yes'); navigator.app.loadUrl("http://google.com", {openExternal : true});
Thanks in advance
android angularjs cordova
CraZyDroiD
source share