Apply constraint using system date in Android-ThrowExceptions

Exception or error:

I am trying to build an app that has a questionnaire and I am storing the values to use them to display a graph as a result at the end. I want that a user should be able to attempt the questionnaire once in 1 week. e.g. If a user attempts it today, he can attempt it after 7 days only but he can attempt the questionnaire which of previous days (e.g. Here user can attempt the questionnaire dated 17/02/2020 and previous dates).

So how do I implement this functionality?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *