What I am trying to do is that when user click a button in a webview page, it starts a service and exit the webview(in animation way if possible).
Asked
Active
Viewed 8,533 times
-1
-
4startService(Intent); finish(); – Blundell Aug 02 '11 at 07:21
-
No new activity is started, only the current webview disappear – user822211 Aug 02 '11 at 07:22
-
finish(); works. It'd be perfect if finish could do something like animation, right! – user822211 Aug 02 '11 at 07:48
-
Check [this post](http://stackoverflow.com/questions/4330675/how-can-i-add-an-animation-to-the-activity-finish/4330695#4330695) for animation – THelper Aug 02 '11 at 08:02
2 Answers
0
You can exit the webView when a specific link is reached. I believe this solution will work in this case.
WebViewClient webViewClient = new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
Log.e("PAGE_URL", url);
if(url.equals("your link...")){
finish();
}
}
};

Jehad Kuhail
- 19
- 5