이것은 내 OnCreate
방법입니다.android WebView가있는 assets 폴더의 로컬 (html/js) 파일?
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
wv = (WebView) findViewById(R.id.webview);
wv_setting = wv.getSettings();
wv_setting.setJavaScriptEnabled(true);
wv.loadUrl("file:///android_asset/home.html");
}
이것은 내 home.html
파일입니다.
<!DOCTYPE HTML>
<html>
<body>
<h1>Hello WebView !</h1>
</body>
<script type="text/javascript" src="app.js"></script>
</html>
이것은 내 파일입니다.
alert('its working');
와 나는 자산 폴더에 home.html
및 app.js
파일이 있습니다.
하지만 작동하지 않습니다 (경고 메시지 없음).
어느 부분이 잘못 되었습니까?