0

I'm trying to collect time stamps through a questionnaire app. Every time the user answers a question I collect the time stamp and send it to the server. That part is working fine through the app. The issue is the questions are on a viewpager w/ 5 fragments. I want to record the time stamp of when the last fragment is destroyed. The way I'm doing that is by using a static method that calls my background task with the necessary parameters I want to pass.
I tried using onDestroy() in the fragment but that doesn't seem to work. Any ideas?

@Override
    public void onDestroy() {
    super.onDestroy();
    Magic.stampThis(getContext(), FINAL_EXIT, user_id);
}
Diego
  • 117
  • 10
  • Possible duplicate of [fragment lifecycle: when "ondestroy" and "ondestroyview" are not called?](http://stackoverflow.com/questions/17195641/fragment-lifecycle-when-ondestroy-and-ondestroyview-are-not-called) – OneCricketeer Nov 04 '16 at 13:53
  • Why don't you just ask for the time stamp when the user submits the questionnaire? – Alex Nov 04 '16 at 14:03

0 Answers0