Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android WebView中的Flash Player NullPointerException_Android_Flash_Webview_Nullpointerexception - Fatal编程技术网

Android WebView中的Flash Player NullPointerException

Android WebView中的Flash Player NullPointerException,android,flash,webview,nullpointerexception,Android,Flash,Webview,Nullpointerexception,在我的应用程序运行一段时间后,我无法将swf加载到网络视图中。我猜flash插件已经崩溃了,但是我不知道如何捕捉这个错误来重新创建webview。出现错误时,webview不会加载swf内容 我使用NanoHTTPD作为web服务器 网络视图代码 WebSettings webSettings = getSettings(); webSettings.setPluginState(PluginState.ON); webSettings.setJavaScriptEnabled(true);

在我的应用程序运行一段时间后,我无法将swf加载到网络视图中。我猜flash插件已经崩溃了,但是我不知道如何捕捉这个错误来重新创建webview。出现错误时,webview不会加载swf内容

我使用NanoHTTPD作为web服务器

网络视图代码
WebSettings webSettings = getSettings();
webSettings.setPluginState(PluginState.ON);
webSettings.setJavaScriptEnabled(true);

setTranslationX(x);
setTranslationY(y);

String uuid = UUID.randomUUID().toString();

String vars = "rssfeed=" + rssSource + "&apppath=" + RSS_PATH + "&imgpath=" +  IMG_PATH;
String filename = "template/" + template;

StringBuffer sBuf = new StringBuffer();
sBuf.append("<html>\n");
sBuf.append("<body style=\"margin:0;width:100%;overflow:hidden;background:"+ bgcolor +     ";\">\n");
sBuf.append("<embed id=\"plugin\" name=\"plugin\" width=\"100%\" height=\"100%\" \n" 
+ "allowScriptAccess=\"sameDomain\" scale=\"exactfit\" wmode=\"transparent\" src=\""
+ filename
+ "\" \n"
+ "type=\"application/x-shockwave-flash\" FlashVars=\""
+ vars
+ "\">\n");
sBuf.append("</body>\n");
sBuf.append("</html>");
String html = sBuf.toString();
Log.d("HTML", html);
addJavascriptInterface(new AreaInterface(Config.getContext()),"AreaInterface");
setWebViewClient(new AreaViewClient());
loadDataWithBaseURL("http://localhost:8081", html, MIME_TYPE, ENCODING, null);
java.lang.NullPointerException
at android.content.res.Resources.openRawResourceFd(Resources.java:982)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:604)
at com.adobe.flashplayer.RawConfigResources.GetAssetFileDescriptor(RawConfigResources.java:37
at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
at android.webkit.JWebCoreJavaBridge.sharedTimerFired(Native Method)
at android.webkit.JWebCoreJavaBridge.fireSharedTimer(JWebCoreJavaBridge.java:92)
at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:108)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:818)
at java.lang.Thread.run(Thread.java:856)