Usage Stats are wrong
Dear Users,
I've found a bug in the newly implemented usage stats ( in Selected Apps screen ), i'll be updating it with the new release.
Bug: Numbers sometimes do not update, or stay the same from 1 day to another. Expected: Numbers should reset every day, stats should be saved/shown second by second.
Hello, it very good apps. and as you mention this bug for "usage stats ( in Selected Apps screen )" , i resolved that as using following code
public class UStats { ........ ........ private static void printUsageStats(List<UsageStats> usageStatsList, int j) { .......... ....... /add following code/ long TimeInforground=usageStatsList.get(i).getTotalTimeInForeground(); int minutes = (int) ((TimeInforground / (100060)) % 60); int seconds = (int) (TimeInforground / 1000) % 60 ; int hours = (int) ((TimeInforground / (10006060)) % 24); String result = String.format("%02d h, %02d min, %02d sec", hours, minutes, seconds ); /*****************************************/
/***remove following old code*******/
/***String result = String.format("%02d h, %02d min, %02d sec",
TimeUnit.MILLISECONDS.toHours(usageStatsList.get(i).getTotalTimeInForeground()),
TimeUnit.MILLISECONDS.toMinutes(usageStatsList.get(i).getTotalTimeInForeground()) -
TimeUnit.MILLISECONDS.toMinutes(TimeUnit.MILLISECONDS.toHours(usageStatsList.get(i).getTotalTimeInForeground())),
TimeUnit.MILLISECONDS.toSeconds(usageStatsList.get(i).getTotalTimeInForeground()) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(usageStatsList.get(i).getTotalTimeInForeground()))
);***/
NOTE: hope this is the correct way to do this as i test its working fine
@rey501 Hey!
Thankyou so much for your contribution. I'll test this whenever i can this evening. Can you make a pull request? If not, I'll add you to the list of contributors when i replace my code with yours :)
Thank you. As i am not very much aware of able to do pull request or not. Could you please test this code and replace if all working fine ?
@rey501
I have a lot of things happening in life right now and i'm not going to be able to do changes and publish them. I will try and work as much as i can in my free time and will give feedback.
Thanks again!
Thank you. As i am not very much aware of able to do pull request or not. Could you please test this code and replace if all working fine ?
Unfortunalty the stats are a little off still ( couple of minutes or so , and sometimes correct. ) I'll have to leave this for a later time.