> hi i have some question about webkit and webview
> i want to show some javascript that already exist in my project
>
> i found i need to survey
> android.webkit.WebView
>
> but i dont know which widget i should select ,
> since there are no android.widget.WebView,

You want android.webkit.WebView.

> and i put image html  and js to folder \myproject\assets
> is that right ?

That should be OK.

> my code :
>
>       WebView webView1 = new WebView(this);
>       webView1 = (WebView) findViewById(R.id.mywebview);
>       webView1.getSettings().setJavaScriptEnabled(true);
>       webView1.loadData(returnStr, "text/html", "utf-8");
>
>       webView1.loadUrl("\myproject\assets\my.html");
>
> webView1.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
>                 this.setContentView(webView1);
>
> there is a error about  webView1.loadUrl("\myproject\assets\my.html");

According to the WebView documentation:

The Android SDK provides a custom scheme to load assets from the
application's .apk file in WebView. The prefix "file:///android_asset/"
will cause WebView to load content from the current application's assets
folder. For example, a myimage.gif file in the /assets folder can be used
in the html image tag as:

<img src="file:///android_asset/myimage.gif">

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.1 Published!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to