当我退出应用程序的声音在后台运行 [英] When I exit an application the sound runs on the background

查看:589
本文介绍了当我退出应用程序的声音在后台运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创造的应用程序,当我回去和我preSS home键从应用程序退出,从我的应用程序中的声音仍在运行!我必须关闭所有运行的应用程序,使之停止。

I "created" an application and when I go back or I press the home button to exit from the application, the audio from my application is still running! I have to close all running apps to make it stop.

我怎样才能停止音频跑步时,我preSS home键?

How can I stop the audio running when I press the home button?

推荐答案

当您单击后退,应用程序不断在后台运行。 如果要停止音乐任何时候你走出了一定的活动覆盖的onStop或在onPause来停止你的声音。类似的东西

When you click back, the app keeps on running in the background. If you want to stop the music any time you get out of a certain activity override onStop or onPause to stop your sound. Something like that

@Override
protected void onStop(){
    super.onStop();
    //your code for stopping the sound
}

这篇关于当我退出应用程序的声音在后台运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆