I making an application android with two Activity. My second Activity contains an youtube video embed. When I launch this activity and run this video it works. But when I close my activity, if my video is playing, my activity is closed but I hear the sond of my video. I think my video is not really closed and she is playing in background.
can you help me?
thank !
edit : I build a test in my MyActivity and I have the same problem.
public class MyActivity extends Activity implements MBAdListener{
private FrameLayout layout;
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
RelativeLayout adViewContainer = (RelativeLayout) findViewById(R.id.adView);
layout = new FrameLayout(this);
layout.setLayoutParams(new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT,
Gravity.CENTER)
);
layout.setBackgroundColor(Color.BLUE);
setContentView(layout);
WebView content = new WebView(this);
content.setLayoutParams(new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT,
Gravity.CENTER
));
content.setHorizontalScrollBarEnabled(false);
content.setVerticalScrollBarEnabled(false);
content.getSettings().setJavaScriptEnabled(true);
content.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
content.getSettings().setBuiltInZoomControls(false);
content.getSettings().setSupportZoom(true);
content.getSettings().setUseWideViewPort(true);
content.getSettings().setPluginsEnabled(true);
content.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
content.getSettings().setSavePassword(true);
content.getSettings().setSaveFormData(true);
content.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
layout.addView(content);
content.loadData("<iframe width=\"320\" height=\"200\" src=\"http://www.youtube.com/embed/vCXRt0kQvUE?autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>", "text/html", "UTF-8");
}