The procedure described here (code
worked fine in my phone. Is there another way to obtain a full log of each time an app was executed?
It could be a log-like history, with a chronological order with a timestamp and app executed (icon clicked). No need for CPU usage. A recent (~1 day) list would suffice.
Edit: my device is a Motorola Moto C Plus with Android 7.0.