Skip to content

Commit

Permalink
HYBRIDAPP: Fix loading issue where webview loads before webserver
Browse files Browse the repository at this point in the history
  • Loading branch information
shaybeau731 committed Dec 12, 2017
1 parent e25ae52 commit 5433897
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/hybridapp/ANDROID_java_oncreate
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mWebView.getSettings().setRenderPriority(RenderPriority.HIGH);

mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);

mWebView.loadUrl("http://localhost:8080");
delayHandler.postDelayed(delayRunnable, 50);

Timer webview_tm = new Timer();
TimerTask webview_task = new TimerTask() {
Expand Down
8 changes: 8 additions & 0 deletions modules/hybridapp/ANDROID_java_variables
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
//private XWalkView mXWalkView;
private WebView mWebView;

Handler delayHandler = new Handler();
Runnable delayRunnable = new Runnable() {
@Override
public void run() {
mWebView.loadUrl("http://localhost:8080");
}
};

0 comments on commit 5433897

Please sign in to comment.