I have an Activity
A and Activity
B.
In Activity
A audio record and playback performs and on the press of back button audiotrack and audio record stops without any issue, but the main problem is in Activity
B there is a video,when the footage of the video ends it moves back to Activity
A.
Now the issue is at this time when I press back button the voice playback starts, means audiotrack and audiorecord doesn't stops.
I have gone through activity life cycle but i didn't got the desired Activity
.
public void onBackPressed() {
super.onBackPressed();
Intent intent = new Intent();
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(Intent.ACTION_MAIN);
startActivity(intent);
m_aboutOnyx.stop();
timer.cancel();
if(c_b_left == 1 || c_b_Right == 1 || c_b_fart ==1 || c_b_transperant ==1 ||c_b_food ==1 ||c_b_thunder ==1 || c_b_thumbs_up ==1){
timer1.cancel();
}
isRecording = false;
track.stop();
track.release();
record.stop();
record.release();
this.finish();
}