Somebody help me?
On May 9, 11:16 am, Anthony <[EMAIL PROTECTED]> wrote: > Hi All, > > I have see this thread as below, but not same as my > question:http://groups.google.com/group/android-developers/browse_thread/threa... > > In my scenario, there are several views, I want to make them run > animation then preserve the animation result. In my code as below, > there are two menu items, click the frist menu item will make a > TextView do animation, and click another will make a ImageView do > animation. But I find every time click one of those menu items, the > last animation result will be clear and reset to its init state before > animation. > Could you help to tell how to preserve view's animation result? > > -- > public boolean onOptionsItemSelected(Item item) { > switch (item.getId()) { > case MENU_ANIM: > TextView animWindow = (TextView)findViewById(R.id.anim); > > // Load the animation from XML (XML file is res/anim/ > move_animation.xml). > Animation anim = > AnimationUtils.loadAnimation(MyAnimation2.this, > R.anim.move_animation); > anim.setRepeatMode(Animation.NO_REPEAT); > > // Play the animation. > animWindow.startAnimation(anim); > break; > > case MENU_ANIM_IMAGE: > ImageView animImage = (ImageView) > findViewById(R.id.anim_image); > > // Load the animation from XML (XML file is res/anim/ > move_animation.xml). > Animation anim1 = > AnimationUtils.loadAnimation(MyAnimation2.this, > R.anim.move_animation); > anim1.setRepeatMode(Animation.NO_REPEAT); > > // > animImage.setImageDrawable(getResources().getDrawable(R.drawable.test)); > animImage.startAnimation(anim1); > break; > > default: > break; > } > > return super.onOptionsItemSelected(item); > } > -- > **Note**: I use the anim XML > fromhttp://code.google.com/android/reference/android/view/animation/packa... > Thank you very much. > > Anthony --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

