I have an app which plays music from a local server and opens music player in the web browser but when the user goes back to the Home activity and launches Another activity which plays a video on the browser, The video opens in a different tab of the browser, while music tab does not get closed.
Can I close an already opened browser tab when another tab opens? If not. Please suggest some workarounds.
You can't control another applications life-cycle . so you can't close tabs that are running in the browser.
what you can do on the other hand is to use WebView to open the audio/video then you have full control over it (what and when) to load/close content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With