I'm afraid that I won't be able to figure this one out without some
help. This code works just fine with the timer delay is set to 100.
Changing it to anything more, say 1000 or 1 second, the animation
doesn't run. Log entries show up correctly no matter what I set for a
delay. There must be something that I need to understand about
animations that I don't yet. Can someone help me. Here is the code
that I'm working with:
-- Thanks
public class FirstAnnim extends Activity {
/** Called when the activity is first created. */
private static int INVISIBLE = 0X4;
private static int VISIBLE =0x0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Make image invisable
findViewById(R.id.image).setVisibility(INVISIBLE);
// create an animation routine
MyAnimationRoutine mar = new MyAnimationRoutine
();
Timer t1 = new Timer ();
t1.schedule(mar, 100);
Log.i("FirstAnnim"," Task started");
}
private class MyAnimationRoutine extends TimerTask {
@Override
public void run () {
Log.i("FirstAnnim"," Timer task started");
// Make image visable
findViewById(R.id.image).setVisibility(VISIBLE);
Animation run_anim= AnimationUtils.loadAnimation
(getApplicationContext(), R.anim.layout_controller);
run_anim.setDuration(5000);
findViewById(R.id.image).startAnimation(run_anim);
findViewById(R.id.image).setVisibility(INVISIBLE);
}
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en