I’m having a problem with a WebView. It’s purpose is to show the frame of a youTube video, then when you touch it, I handle the touch event myself and play a local video. The problem is that every now and then, when it goes to display the WebView, it immediately launches the device’s browser and takes the user to the Youtube video. It feels like the WebView is blowing up from the frame and taking over the app.
I don’t know why this is happening! Any help is appreciated.
mWebView.setVisibility(View.VISIBLE);
mWebView.setOnTouchListener(this);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setSupportZoom(false);
mWebView.loadUrl("http://www.youtube.com/v/" + lesson.getYoutubeID());
That will occur if:
http://www.youtube.com/v/" + lesson.getYoutubeID()results in an HTTP redirect, andYou do not handle that redirect via a
WebViewClientandshouldOverrideUrlLoading()