UsageStatsManager manager = (UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE);
UsageEvents events = manager.queryEvents(range[0], range[1]);
//range[0] is 25th April,2018 converted in long, and range[1] is May 25,2018 in long
The query returns event starting from May 18,2018, but I clearly added April 25th as the date. Is there any other way to retrieve the whole month usage stats?
This is by design. The docs for UsageStatsManager.queryEvents() say the following (emphasis mine):
To look back further in time, try UsageStatsManager.queryUsageStats().