2011-11-10 49 views
0

我用LimeJS做了一個遊戲,我想爲這個遊戲製作一個Android應用程序。我使用Android Browser測試了遊戲,並且它運行良好,但是當我在WebView中的應用程序中使用遊戲時,它不起作用。 Web視圖看起來像作品以及與頁面不石灰WebView不加載LimeJS資源

下面是web視圖代碼:

//WebView 
mWebView = (WebView) findViewById(R.id.webView); 
mWebView.setVerticalScrollbarOverlay(true); 

//Settings to configure the webViewBrowser to show Flash and respond to links 
WebSettings webSettings = mWebView.getSettings(); 
webSettings.setJavaScriptEnabled(true); 
webSettings.setAllowFileAccess(true); 
webSettings.setPluginsEnabled(true); 

//I changed the url to a LimeJS example 
mWebView.loadUrl("http://www.limejs.com/static/roundball/index.html"); 

測試我使用的嗅探器一段時間後,我意識到,我的Android應用程序不要求輸入資源到服務器,但Android瀏覽器進行呼叫。

有人知道如何配置WebView使其工作?

回答

1

使用本地存儲解決了問題。 webSettings.setDomStorageEnabled(true);

我發現this對Android文檔有用,用於調試WebApp