File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
pythonforandroid/bootstraps/webview/build/templates Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -18,32 +18,29 @@ public class WebViewLoader {
18
18
public static void testConnection () {
19
19
20
20
while (true ) {
21
- if (WebViewLoader .pingHost ("localhost" , 5000 , 100 )) {
22
- Log .v (TAG , "Cuccessfully pinged localhost:5000 " );
21
+ if (WebViewLoader .pingHost ("localhost" , {{ args . port }} , 100 )) {
22
+ Log .v (TAG , "Successfully pinged localhost:{{ args.port }} " );
23
23
Handler mainHandler = new Handler (PythonActivity .mActivity .getMainLooper ());
24
24
25
25
Runnable myRunnable = new Runnable () {
26
26
@ Override
27
27
public void run () {
28
- PythonActivity .mActivity .mWebView .loadUrl ("http://127.0.0.1:5000 /" );
28
+ PythonActivity .mActivity .mWebView .loadUrl ("http://127.0.0.1:{{ args.port }} /" );
29
29
Log .v (TAG , "Loaded webserver in webview" );
30
30
}
31
31
};
32
32
mainHandler .post (myRunnable );
33
33
break ;
34
34
35
35
} else {
36
- Log .v (TAG , "Could not ping localhost:5000 " );
36
+ Log .v (TAG , "Could not ping localhost:{{ args.port }} " );
37
37
try {
38
38
Thread .sleep (100 );
39
39
} catch (InterruptedException e ) {
40
40
Log .v (TAG , "InterruptedException occurred when sleeping" );
41
41
}
42
42
}
43
43
}
44
-
45
- Log .v (TAG , "testConnection finished" );
46
-
47
44
}
48
45
49
46
public static boolean pingHost (String host , int port , int timeout ) {
You can’t perform that action at this time.
0 commit comments