Hi, I have an activity A which invokes Activity B on Button Click,and a Button click on Activity B invokes Class C. When button is clicked in Activity B , B calls a static method in Class C which passes its reference as one of the argument to method in C and other argument is path to the sound file that needs to be played. Once control reaches class C , Audio is played. But when Backkey is pressed Audio doesnot stop it continuous to play. How can I make the Audio to stop when BackKey is pressed. More over when Backkey is pressed control is coming to Activity A instead of Activity B. Can any one help me in solving this issue?
class activityA extends Activity
{
startIntent(ActivityB) on ButtonPress
}
class ActivityB extends Activity
{
classc.playAudio(ActivityB.this,audiopath);
}
class c
{
playAudio(Activity a, audiopath)
{
sound code to play audio is done here.
}
}