I created an application with help of http://coenraets.org/blog/cordova-phonegap-3-tutorial/. When I click on the SMS link in the Employee details view it opens native message composer because the link's is as href="sms:6170000010"
, but when I click on the Android back button while message composer is opened it takes the application to previous view something like window.history.back()
, but I want only to close message composer. How can I customise my source code to only close the message composer when back button is pressed for this particular situation and for rest of the application should behave as it is?
Below is Employee details view screenshot:
I Fixed it using HTML5 History pushState function.This allow me to add history entry in History Array. So on android back button click will pop current(smsComposer) view from the history array and employee details view will be as it is.
<a href="sms:6170000010" onClick="modifyBrowserHistory()" >
function modifyBrowserHistory(){
window.history.pushState({page:"smsComposer"},"sms composer");
}