ttsolution Member Licensed User Longtime User Jul 25, 2015 #1 Dear All, Using webview, is there any way to load aspx web pages in background? My Activity have 04 webview, I want to load the webview1 first and the the webview2,webview3,webview4 in background. Many thanks for any help. Jonh,
Dear All, Using webview, is there any way to load aspx web pages in background? My Activity have 04 webview, I want to load the webview1 first and the the webview2,webview3,webview4 in background. Many thanks for any help. Jonh,
ArminKH Well-Known Member Jul 25, 2015 #2 put this code into a Service Code: Copy Public Sub AddWebView(WebView1 As WebView) WebView1.LoadUrl("http://www.google.com") End Sub then use this code in your activity Code: Copy CallSubDelayed2(YourService,"AddWebView",WebView1) StartService(YourService) CancelScheduledService(YourService) Upvote 0
put this code into a Service Code: Copy Public Sub AddWebView(WebView1 As WebView) WebView1.LoadUrl("http://www.google.com") End Sub then use this code in your activity Code: Copy CallSubDelayed2(YourService,"AddWebView",WebView1) StartService(YourService) CancelScheduledService(YourService)
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2015 #3 The answer above is incorrect. WebView always loads its content in the background. If for some reason you want to load the first page and only then start loading the second page then you need to handle the PageFinished event and then load the next page. Upvote 0
The answer above is incorrect. WebView always loads its content in the background. If for some reason you want to load the first page and only then start loading the second page then you need to handle the PageFinished event and then load the next page.
ArminKH Well-Known Member Jul 26, 2015 #4 Erel said: The answer above is incorrect. WebView always loads its content in the background. If for some reason you want to load the first page and only then start loading the second page then you need to handle the PageFinished event and then load the next page. Click to expand... Erel my post is about a way to use webview in service when our app is closed I know activity object can't assigned in service but this code works and this is my own solution for example when i want to reload a web page on background when my app is closed(Anti Idle user) Is this wrong? Last edited: Jul 26, 2015 Upvote 0
Erel said: The answer above is incorrect. WebView always loads its content in the background. If for some reason you want to load the first page and only then start loading the second page then you need to handle the PageFinished event and then load the next page. Click to expand... Erel my post is about a way to use webview in service when our app is closed I know activity object can't assigned in service but this code works and this is my own solution for example when i want to reload a web page on background when my app is closed(Anti Idle user) Is this wrong?
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2015 #5 Maybe I misunderstood the original question. I don't recommend using a WebView from a service. You should instead use HttpUtils2. Upvote 0
Maybe I misunderstood the original question. I don't recommend using a WebView from a service. You should instead use HttpUtils2.
ttsolution Member Licensed User Longtime User Jul 27, 2015 #6 My case is : I have an aspx webpage show a sales report by Quarter. In my activity I have 04 webview stand for Quater1,Quater2, Quater3, Quater4 and I'm using StdViewPager that allows user slide Quarter to Quarter. For optimized loading speed I wish to load the current Quarter first and the remain 03 quarters will be loaded in background. I tried with arminkh solution & I works Many thanks, Jonh. Upvote 0
My case is : I have an aspx webpage show a sales report by Quarter. In my activity I have 04 webview stand for Quater1,Quater2, Quater3, Quater4 and I'm using StdViewPager that allows user slide Quarter to Quarter. For optimized loading speed I wish to load the current Quarter first and the remain 03 quarters will be loaded in background. I tried with arminkh solution & I works Many thanks, Jonh.