0

I have a registration page in web view which I am using in an Android application, after successful registration it should redirect intent which is not webview. Is it possible to do so? And if possible are there any suggestions for doing this?

My project is in Eclipse.

james.garriss
  • 12,959
  • 7
  • 83
  • 96
prashant
  • 57
  • 1
  • 1
  • 15
  • 2
    Have you tried to accomplish this so far? Some code may help along with some more specific details pertaining to your problem – J. Schei Jul 13 '16 at 16:08
  • http://stackoverflow.com/questions/7661033/android-webview-call-activity-methods-form-javascript-interface – ka_lin Jul 13 '16 at 16:17
  • After successful registration does it redirects to any page or fire any events e.g. after success it goes so some page in the webview only so as we can track that and fire "Intent" on the basis of that. – Ravi Rawal Jul 13 '16 at 19:05

1 Answers1

0

Show the alert in webview and get this done as below as there is a callback (onJsAlert) when any alert is shown.

private void loadWebViewStuff() { 
        myWebView.setWebChromeClient(new MyWebChromeClient()); 
        myWebView.loadUrl(URL); 
} 


final class MyWebChromeClient extends WebChromeClient {
    @Override 
    public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
        //"message" is what is shown in the alert, here we can do whatever with it 
    } 
} 
Amit Shekhar
  • 3,135
  • 2
  • 16
  • 17