@Mark Murphy
That's a good idea but my goal is to have the view only appear after
screen inactivity.  So I want/need the ability to cancel the scheduled
animation.

@Romain Guy
It has been my understanding and experience that a Handler object
could be used to schedule things on the UI thread.  Yet if I use a
Handler, the behavior is the same as using the Timer (although that
could be due to different causes).  As I wrote before, I have tried a
Handler and runOnUiThread() to little success.

Although the problem hasn't been solved, thank you all for replying
and replying so quickly.

On Mar 9, 7:28 pm, Mark Murphy <[email protected]> wrote:
> That's odd.
>
> Another thing you can try is getting rid of the timer/runnable stuff
> and use android:startOffset to provide your delay.
>
>
>
>
>
>
>
>
>
> On Wed, Mar 9, 2011 at 8:22 PM, Jeff Meyerhoff <[email protected]> wrote:
> > The problem persists.  By having the startAnimation in the view's
> > onClick, it fires just fine.  The problem starts as soon as I move it
> > into a Runnable or TimerTask called by either a Handler or Timer
> > respectively.
>
> > Basically what I'm doing is this:
>
> >        private Runnable fadeInInfo = new Runnable() {
> >                public void run() {
>
> > findViewById(R.id.TextViewInformation).startAnimation(animationFadeIn);
> >                }
> >        };
>
> >        View.OnClickListener clickListener = new View.OnClickListener() {
> >                public void onClick(View v) {
> >                        handle.postDelayed(fadeInInfo, 2000);
> >                }
> >        };
>
> > On Mar 9, 5:55 pm, Dianne Hackborn <[email protected]> wrote:
> >> Oh definitely just don't use Timer.  It is only trouble when interacting
> >> with the Android frameworks. :}
>
> >> On Wed, Mar 9, 2011 at 3:49 PM, Mark Murphy <[email protected]> 
> >> wrote:
> >> > Also, instead of a Timer, try using postDelayed() on the Handler (or
> >> > any View) for your delay, and see if that helps.
>
> >> > On Wed, Mar 9, 2011 at 6:45 PM, Dianne Hackborn <[email protected]>
> >> > wrote:
> >> > > A working API demo is here:
>
> >> >http://developer.android.com/resources/samples/ApiDemos/src/com/examp...
> >> > > That seems to be what you are describing that you do, but there must be
> >> > > something different.  Try reducing your code to that and seeing where 
> >> > > it
> >> > > starts working.
>
> >> > > On Wed, Mar 9, 2011 at 3:09 PM, Jeff Meyerhoff <[email protected]> 
> >> > > wrote:
>
> >> > >> I am trying to start an animation after a delay from a Timer.
> >> > >> However, calling startAnimation() does not, well, start the
> >> > >> animation.  The animation that I set up with View.startAnimation()
> >> > >> only happens once I either touch the screen or scroll the scroll ball.
>
> >> > >> I have tried using a Handler, using runOnUiThread(), and neither to
> >> > >> see if it was an issue with not being on the UI thread.  Any help you
> >> > >> can give would be greatly appreciated.  This thing is killing me.
>
> >> > >> --
> >> > >> 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
>
> >> > > --
> >> > > Dianne Hackborn
> >> > > Android framework engineer
> >> > > [email protected]
>
> >> > > Note: please don't send private questions to me, as I don't have time 
> >> > > to
> >> > > provide private support, and so won't reply to such e-mails.  All such
> >> > > questions should be posted on public forums, where I and others can see
> >> > and
> >> > > answer them.
>
> >> > > --
> >> > > 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
>
> >> > --
> >> > Mark Murphy (a Commons Guy)
> >> >http://commonsware.com|http://github.com/commonsguy
> >> >http://commonsware.com/blog|http://twitter.com/commonsguy
>
> >> > Android Training Worldwide:http://commonsware.com/training
>
> >> > --
> >> > 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
>
> >> --
> >> Dianne Hackborn
> >> Android framework engineer
> >> [email protected]
>
> >> Note: please don't send private questions to me, as I don't have time to
> >> provide private support, and so won't reply to such e-mails.  All such
> >> questions should be posted on public forums, where I and others can see and
> >> answer them.
>
> > --
> > 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
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training Worldwide:http://commonsware.com/training

-- 
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