Android Question WebView Stop Activity_Pause Event

hasexxl1988

Active Member
Licensed User
Longtime User
Hello,
does anyone know how I can set the activity so that a playback that runs on a WebView in the Activity also continues when I go out of the App?

I tried the following code:

B4X:
Sub Activity_Resume
    WebView1.LoadUrl(WebView1.Url)
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    WebView1.LoadUrl(WebView1.Url)
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
You can not use webview when you quit your app. Your app is then in the background and does not show any UI anymore.
 
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
I did not mean running the Webview in a service. Obviously he wants the user to continue to listen to something while his app is paused. The service might be able to play that mp3, stream o.a. (?)

Yes Stream (Streamcloud, Youtube and more)

if I lock the Display the music continues, only if I leave the app stops everything directly.
 
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
But NOT in a Webview! And he is asking about a Webview.

There are ways to find the real stream in Youtube (not the URL that Youtube shows at the top of the sceen, but a much more complicated longer URL), although finding these streams is not so easy. You could probably store that stream (while your app is running) and pass it on to a mediaplayer in the service.

Thank you for your prompt reply :)
 
Upvote 0
Top