Android WebView not stopping after user presses back

后端 未结 6 1785
傲寒
傲寒 2021-01-31 03:18

I am playing a YouTube video inside a WebView. I am able to play it, but when the person leaves the screen, I am not able to stop the audio from playing.

I tried various

6条回答
  •  旧时难觅i
    2021-01-31 03:28

    In activity's onDestroy() do:

    @Override
    protected void onDestroy() {
        super.onDestroy();
        webView.destroy();
    }
    

提交回复
热议问题