This app was mentioned in 1 comment, with an average of 2.00 upvotes
I'm on iOS so I have no direct experience, but I suspect that what you want is not a medication-tracking app, but an event-tracking app.
Medication apps are all about reminding you to take your medication on a schedule. It sounds like you want to take note of when you take unscheduled meds, and simply track what's happened in the near past.
This might work:
https://play.google.com/store/apps/details?id=com.lollypopmen.et.android
It looks a little fussy but at it's core it's a two-click way of noting that a med was taken, and the note can expire after a day.