I have two Date objects. EndDate and StartDate.
I want to show difference(including hours and minutes) between this dates in progressbar.
I initialized two long variables with Date.getTime() and then calculated difference.
But ProgressBar.setProgress() and ProgressBar.setMax() accept only int.
How can I solve this problem?
longis a integer type. You can cast without issue if the difference does not exceed theintsize.A
longche holds2^(63-1)values, anint2^(31-1).If the value you are setting throughsetMax()you can cast it tointwithout issue.