Skip to content

Commit b04dd04

Browse files
committed
webview: put webview_includes in assets dir
1 parent fe5d722 commit b04dd04

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ def make_package(args):
309309
if exists(python_bundle_dir):
310310
tar_dirs.append(python_bundle_dir)
311311
if get_bootstrap_name() == "webview":
312-
tar_dirs.append('webview_includes')
312+
for asset in listdir('webview_includes'):
313+
shutil.copy(join('webview_includes', asset), join(assets_dir, asset))
313314

314315
for asset in args.assets:
315316
asset_src, asset_dest = asset.split(":")

pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android/PythonActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void onClick(DialogInterface dialog,int id) {
159159
mWebView = new WebView(PythonActivity.mActivity);
160160
mWebView.getSettings().setJavaScriptEnabled(true);
161161
mWebView.getSettings().setDomStorageEnabled(true);
162-
mWebView.loadUrl("file:///" + app_root_dir + "/_load.html");
162+
mWebView.loadUrl("file:///android_asset/_load.html");
163163

164164
mWebView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
165165
mWebView.setWebViewClient(new WebViewClient() {

0 commit comments

Comments
 (0)