I am developing an application for android 3.0 tablet, that's supposed to play swf files inside a WebView. First I tried to open the swf file from the device, than through the internet, with no luck. The WebView shows up, but inside the WebView all I can see is a black screen (with a 3-4 px wide white line on the right). If I load the same URL to the device browser, the flash file plays well. I think Im missing something on the WebView setup, but after a few hours of searching and googling I still dont know what.
The Java code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.presentation);
presentationWebView = (WebView) findViewById(R.id.presentation_webview);
presentationWebView.getSettings().setJavaScriptEnabled(true);
presentationWebView.getSettings().setPluginsEnabled(true);
presentationWebView.getSettings().setAllowFileAccess(true);
presentationWebView.loadUrl("http://my_domain/fileName.swf");
}
The presentation.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id = "@+id/presentation_webview"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"/>
</LinearLayout>
Thank you very mouch for any answers. Ripityom