Android Question Problem refresh Webview

MetalOS

Member
Licensed User
Longtime User
Hello,

for the realization of a radio player I use a webview which will load the title of the music in court of reading. I refresh this webview every 20 seconds but nothing happens when my timer works well. The only time my webview updates some seconds after the end of a music is when I switch my smartphone to go into portrait mode. The webview and up-to-date with new music in reading court. How to make the webview update without breaking the screen? I attach you to this post an example file.
 

Attachments

  • shoucast.zip
    10.8 KB · Views: 208

mangojack

Well-Known Member
Licensed User
Longtime User
It seems to work OK here .. If I understand you correctly.

Try this sample ... I have removed the WebView completely and just get the new song title every 5 seconds (displayed in a label)

It might give you ideas on alternatives.
 

Attachments

  • GenericSample Exo1.zip
    10.9 KB · Views: 220
Upvote 0

MetalOS

Member
Licensed User
Longtime User
A big thank you that's exactly what I'm trying to do. As a beginner in programming and on B4A the webview was a simple way for me. Thanks again.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You should ALWAYS create a new Thread for any new Question.
Also make sure everyone understand the problem. I think i do not understand correctly what the question is.
 
Upvote 0

MetalOS

Member
Licensed User
Longtime User
Sorry for my English I use Google Translate. The question is still about the mangojack code. I wanted to know if the recovery of the title still worked even if the screen was in standby.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
If the screen is in Standby then your activity will get moved into pause. So no updates were made on this Activity.
If you process is not killed and you open the Screen again your app will get resumed and updates can be done again.

See https://www.b4x.com/etp.html
Especially B4A Life-Cycle
 
Upvote 0
Top