Scratch all that - my whiteboard tells me I'm going about this all
wrong. **NEW QUESTION**:

Here's what I think the code should look like:

...
     Time TimerSet = new Time();
     TimerSet.set(0, 0, 0, 8, 0, year);  // set the date to Jan 8,
(declared year), 12am (a family birthday)
     TimerSet.normalize(true);
     long millis = TimerSet.toMillis(false);

     Time TimeNow = new Time();
     TimeNow.setToNow();  // set the date to Current Time
     TimeNow.normalize(true);
     long millis2 = TimeNow.toMillis(false);

     long millisset = millis - millis2;   //subtract current from
future to set the time remaining

new CountDownTimer(millisset, 1000) {
     public void onTick(long millisUntilFinished) {

// this section drills it down to hours:minutes:seconds for display
and the code works already

     myTextView.setText(hours + ":" + minutes + ":" + seconds);
     }

     public void onFinish() {

// HERE"S WHERE THE QUESTION STARTS: WILL THIS WORK??

          if (millis2 <= (millis + 86400) {    //checks to see if time
now is within 1 day of finish
               myTextView.setText("HAPPY BIRTHDAY!");
          } else {
               year = year + 1
          }
     }.start();

*** NEED A COMMAND TO RESTART THE SEQUENCE BACK AT Time TimerSet = new
Time();

I'm thinking I could use a new countdowntimer inside the if at
onFinish() to count the day down, but am really confused about how to
restart the countdown once it's finished. Also is there an easy way to
write a variable to the SD card to keep the year variable from
resetting every time the program closes?

Sorry for being dense and using CAPS in the code. Wish I could
highlight with color instead.

Thanks, -Larry

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to