androidstudio创建assets目录并且利用webView加载其html_html/css
来源:懂视网
责编:小采
时间:2020-11-27 16:28:47
androidstudio创建assets目录并且利用webView加载其html_html/css
androidstudio创建assets目录并且利用webView加载其html_html/css_WEB-ITnose:1、在Android Studio中添加assets目录,首先调整成project模式 在main的目录下新建一文件夹叫:assets 。 WebView\src\main\assets 在项目的WebView.iml中加入: 2、在利用webView加载html文件 @Override protect
导读androidstudio创建assets目录并且利用webView加载其html_html/css_WEB-ITnose:1、在Android Studio中添加assets目录,首先调整成project模式 在main的目录下新建一文件夹叫:assets 。 WebView\src\main\assets 在项目的WebView.iml中加入: 2、在利用webView加载html文件 @Override protect

1、在Android Studio中添加assets目录,首先调整成project模式
在main的目录下新建一文件夹叫:assets 。 WebView\src\main\assets
在项目的WebView.iml中加入:
2、在利用webView加载html文件
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webView = (WebView) findViewById(R.id.webView); webView.loadUrl("file:///android_asset/web.html"); }
androidstudio创建assets目录并且利用webView加载其html_html/css
androidstudio创建assets目录并且利用webView加载其html_html/css_WEB-ITnose:1、在Android Studio中添加assets目录,首先调整成project模式 在main的目录下新建一文件夹叫:assets 。 WebView\src\main\assets 在项目的WebView.iml中加入: 2、在利用webView加载html文件 @Override protect