When i play a video in android webview it play perfectly but when i press the back button or home key than it does not stop the sound. it play in background.
When i remove my application from recent apps than this sound is stop otherwise it play in background.
I try all the solution given in below link. but no one is working for me. http://devsolvd.com/questions/how-to-stop-youtube-video-playing-in-android-webview
This problem is not occur in Android 4.1 In android 4.4.2(Kitkat) webview plays sound in background.
My Code is
@Override
protected void onResume()
{
// TODO Auto-generated method stub
super.onResume();
if (onResumeCall)
{
webView.onResume();
setContentsData();
if (contentHolders.size() > 0)
selectItem(currentIndex, 0, FIRST_PAGE);
}
onResumeCall = true;
//webView.onResume();
Log.i("OnREsume", "OnREsume");
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
@Override
public void onBackPressed() //when back pressed then
{
// TODO Auto-generated method stub
super.onBackPressed();
}
I try many things but it is not working. Plz Help Me.