3

I'm working on an android native application, and I'm using a Webview to load my android_asset/www/index.html file:

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends Activity
{
    final Activity activity = this;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView webView = (WebView) findViewById(R.id.webview);
        webView.getSettings().setJavaScriptEnabled(true);

        webView.setWebChromeClient(new WebChromeClient() {

        });

        webView.setWebViewClient(new WebViewClient() {
            @Override
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
            {
                // Handle the error
            }
        });

        webView.loadUrl("file:///android_asset/www/index.html");
    }
}

This all works great, untill I place the import for the jquery-mobile js in the header:

<html>
<head>
    <link rel="stylesheet" href="css/jquery.mobile-1.2.0.min.css" />
    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/jquery.mobile-1.2.0.min.js"></script>
</head>

<body>
</body>

When I include the jquery mobile js into my html document, logcat gives me a Unknown chromium error -6. This doesn't happen when I include the normal jquery js.

I am running my application on nexus S with android 4.0.3

Is there anybody that has experience using this framework?

Thanks in advance

4

1 に答える 1

1

まだ解決策が見つからない場合は、同じ問題を検索しているときに、次のリンクに出くわしました。

Phonegapディスカッショングループ

Stackoverflowに関する質問

于 2012-12-11T05:08:29.930 に答える