I have an android activity with WebView in it. When the activity loads with a page, it has two buttons (in html) one for accept and one for decline.
When the user clicks accept, the application works the way it should.
What I want is when a user clicks the decline button, the application should go to the previous activity. Since this is a webview so it has to be done through javascript. I have already tested running javascript and can execute toast messages from webpage.
I want an exact line which I should write to close the activity, or go back.
Secondly, can I track the URLs which web view is going to, as Once the job of webview is done, and it goes to a specific page, and from there I want to return to my application, how can this be done?