The results are as follows:
The layout file is as follows:
<Relativelayout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: Tools = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "match_parent"> <webview Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: Id = "@ + ID/webview"/> </relativelayout>
CodeImplementation:
Public class mainactivity extends activity {/************* by: lixiaodaoaaa QQ: 346825741 http://t.qq.com/lixiaodaoaaa/ **** http://weibo.com/lixiaodaoaaa */@ override public void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. activity_main); initalldatas ();} private void initalldatas () {webview = (webview) This. findviewbyid (R. id. webview); webview. getsettings (). setjavascriptenabled (true); // allows the use of JavaScript scripting language webview. getsettings (). setbuiltinzoomcontrols (true); // You can scale or setJavascriptCan be used to operate mainactivity class webview. addjavascriptinterface (this, "mainactivity"); webview. loadurl ("file: // android_asset/mypie3ddemo.html ");}}
The ichart-1.0.jsand mypie3ddemo.htm files must be imported into the project. Put the two files in the asset directory.
Download csdn resources slam here: http://download.csdn.net/detail/lixiaodaoaaa/5091702
Other places:Http://pan.baidu.com/share/link? Consumer id = 347893 & UK = 1845783037