Reputation: 1896
I am trying to run a simple flash video player on android. I can only a block with a question mark. Can someone tell what is wrong with this code?
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@Override
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host,String realm){
String[] up = view.getHttpAuthUsernamePassword(host, realm);
if( up != null && up.length == 2 ) {
handler.proceed(up[0], up[1]); }
else Log.d("WebAuth","Could not find user/pass for domain :"+ host+" with realm = "+realm);
}
});
webview.getSettings().setSupportZoom(true);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setAllowFileAccess(true);
webview.getSettings().setPluginsEnabled(true);
webview.loadUrl("http://tvforandroid.com/p/?p=1020");
Upvotes: 1
Views: 2682
Reputation:
webview.getSettings().setPluginsEnabled(true); is a deprecated method try targeting min SDK version 8 (2.2) and setting webview.getSettings().setPluginState(WebSettings.PluginState.ON);
Upvotes: 1
Reputation: 91
Are you sure flashplayer is available on the device you're testing on? Not all android devices support it.
Upvotes: 0