Skip to content

Commit 8ab7c95

Browse files
authored
Merge pull request #2412 from obfusk/webview-assets
webview: put webview_includes in assets dir
2 parents c148a75 + b04dd04 commit 8ab7c95

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
@@ -314,7 +314,8 @@ def make_package(args):
314314
if exists(python_bundle_dir):
315315
tar_dirs.append(python_bundle_dir)
316316
if get_bootstrap_name() == "webview":
317-
tar_dirs.append('webview_includes')
317+
for asset in listdir('webview_includes'):
318+
shutil.copy(join('webview_includes', asset), join(assets_dir, asset))
318319

319320
for asset in args.assets:
320321
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
@@ -160,7 +160,7 @@ public void onClick(DialogInterface dialog,int id) {
160160
mWebView = new WebView(PythonActivity.mActivity);
161161
mWebView.getSettings().setJavaScriptEnabled(true);
162162
mWebView.getSettings().setDomStorageEnabled(true);
163-
mWebView.loadUrl("file:///" + app_root_dir + "/_load.html");
163+
mWebView.loadUrl("file:///android_asset/_load.html");
164164

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

0 commit comments

Comments
 (0)