android - Launch new activity (within same app) after login successful -


following code url overriding. after users logs in successfully, main activity loads next webpage. want redirect new activity(within app only) user experience made better. how do this? following code isn't working. tracked successful login event using debugger in firefox , used particular part of url "app?service".

note: code works after click event happens in newly loaded webpage. want happen automatically after successful login.

    webview.setwebviewclient(new webviewclient() {         @override         public boolean shouldoverrideurlloading(webview view, string url) {             if (url.contains("app?service")) {                 intent intent = new intent(login.this, status.class);                 intent.putextra("url", url);                 startactivity(intent);             }             return true;          }          @override         public void onpagefinished(webview view, string url) {             //my code         }     }); 

can please help? in advance!

move code in onpagefinished() method

    @override     public void onpagefinished(webview view, string url) {         if (url.contains("app?service")) {             intent intent = new intent(login.this, status.class);             intent.putextra("url", url);             startactivity(intent);         }     } 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -