Back to project page Google-IO-Countdown-for-Android.
The source code is released under:
GNU General Public License
If you think the Android project Google-IO-Countdown-for-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.javiersantos.googleiocountdown; //ww w . j a v a 2 s . c o m import android.text.format.Time; public class Counter { private long intervalMillis; public Counter(int second, int minute, int hour, int monthDay, int month, int year) { Time futureTime = new Time(); // Set date to future time futureTime.set(second, minute, hour, monthDay, month, year); futureTime.normalize(true); long futureMillis = futureTime.toMillis(true); Time timeNow = new Time(); // Set date to current time timeNow.setToNow(); timeNow.normalize(true); long nowMillis = timeNow.toMillis(true); // Subtract current milliseconds time from future milliseconds time to retrieve interval intervalMillis = futureMillis - nowMillis; } public long getIntervalMillis() { return intervalMillis; } }