Or onStart or onResume too.
Solving.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
No code no truth.
Reply:
Yeah drink, you also like to have a code?
Reply:
animationDrawable a AnimationDrawable (nonsense ......)
Defined as follows:
imageView.setBackgroundResource (R.drawable.anim_list);
animationDrawable = (AnimationDrawable) imageView.getBackground ();
--------------- Listener will be able to play in a movie -------------------------- ------
imageView.setOnClickListener (new OnClickListener () {
@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
animationDrawable.start ();
}
});
--------------- Where it does not work in a onCreate ---------------------------- ----
@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
animationDrawable.start ();
}
Reply:
public void start ()
Added in API level 1
Starts the animation, looping if necessary. This method has no effect if the animation is running. Do not call this in the onCreate (Bundle) method of your activity, because the AnimationDrawable is not yet fully attached to the window. If you want to play the animation immediately, without requiring interaction, then you might want to call it from the onWindowFocusChanged (boolean) method in your activity, which will get called when Android brings your window into focus.
No comments:
Post a Comment