Groups
Groups
Sign in
Groups
Groups
日本Androidの会
Conversations
About
Send feedback
Help
WebViewの終了方法
1,420 views
Skip to first unread message
eijixAG
unread,
Apr 27, 2011, 3:28:02 AM
4/27/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 日本Androidの会
こんにちは。
eijixAGです。
WebViewを閉じるには、どうしたら良いのでしょうか。
======
WebView webview = (WebView) findViewById(R.id.Webview);
webview.setWebViewClient(new WebViewClientDemo());
webview.loadUrl(uri);
======
という感じで、WebViewを生成。
WebView内でリンク遷移する必要があるので、WebViewClientも。
で、このWebViewで色々処理し、
特定のurlに遷移したら、違うアクティビティに遷移したいのです。
onPageFinishedにて、読み込みurlを監視し、特定のurlを読み込み終えたところで、
インテントで別のアクティビティに移ろうとしています。
======
public void onPageFinished(WebView view, String url) {
setProgressBarIndeterminateVisibility(false);
if (url.startsWith(dum_str)) {
Intent intent = new Intent(thisAct.this, nextAct.class);
intent.putExtra("PARAM", param);
startActivity(intent);
finish();
}
}
======
WebViewから強引に別のアクティビティに移っているからか、残骸と思えるものが悪さをしてる気がします。
必ず先のアクティビティでエラー終了してしまいます。
インテント命令を発行したら、WebViewを閉じる(終了する)ことは出来ますか?
ブラウザ履歴の戻る・進むは見つかるんですが、閉じるというのがわかりません。
そもそもWebViewに閉じたり、終了したりなどは必要ないのでしょうか?
以上、よろしくお願いします。
eijixAG
Reply all
Reply to author
Forward
0 new messages