Saving a timestamp in SharedPreferences should suffice. If you're worried about security, you could use a crypto library (see this SO link) and save the datetime in a file, but that is most likely overkill.
To use the SharedPreferences with Dates, it it easy enough to use a formatted string (with day-precision) of a java.util.Date object.
For example, to persist a java.util.Date class to SharedPreferences as a formatted string:
//pre-condition: variable "context" is already defined as the Context object in this scope
String dateString = DateFormat.format("MM/dd/yyyy", new Date((new Date()).getTime())).toString();
SharedPreferences sp = context.getSharedPreferences("<your-app-id>", Context.MODE_PRIVATE);
Editor editor = sp.edit();
editor.putString("<your-datetime-label>", dateString);
editor.commit();
To retrieve the dateTime again from SharedPreferences, you could try:
//pre-condition: variable "context" is already defined as the Context object in this scope
SharedPreferences sp = context.getSharedPreferences("<your-app-id>", Context.MODE_PRIVATE);
String savedDateTime = sp.getString("<your-datetime-label>", "");
if ("".equals(savedDateTime)) {
//no previous datetime was saved (allow button click)
//(don't forget to persist datestring when button is clicked)
} else {
String dateStringNow = DateFormat.format("MM/dd/yyyy", new Date((new Date()).getTime())).toString();
//compare savedDateTime with today's datetime (dateStringNow), and act accordingly
if(savedDateTime.equals(dateStringNow){
//same date; disable button
} else {
//different date; allow button click
}
}
This makes it rather simple to persist dates and check them again.
You could also store the System's timeInMillis, and use a long value in shared preferences instead of a string representation of the date.