Ok i have a problem.Currently i have edited my CordovaWebView.java class so that when i press the device back 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's 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'm opening a new web page from my application it just opens the web page inside my application itself. So i dont have a way to go back after i go to my web page because the application will be asked to close because of the edits i have done.
Is there a way to open a web page in device browser OR can i make a additional edit to go back when a web page is opened.
i tried these methods to open in device brower but did not 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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…