I am working on exam application where user is taking exam. In case user completes 40% exam and moves app to back stack and then removes it from recent tab i want to save the total progress in that case. I tried doing it using ondestory activity but on destory is not called everytime the app is cleared. this is my code for on destroy.
@Override
protected void onDestroy() {
super.onDestroy();
Toast.makeText(getApplicationContext(),"On destroy called",Toast.LENGTH_LONG).show();
}
There is a fragment on which the questions are inflated and i tried calling ondestroyview there but it also didn't solved my problem.
@Override
public void onDestroyView() {
super.onDestroyView();
Toast.makeText(getContext(),"On destroy view called",Toast.LENGTH_LONG).show();
}
How can i get the event when the app is removed from the recent tabs. I searched a lot but couldn't find anything.