Created
October 27, 2012 11:47
-
-
Save valllllll2000/3964385 to your computer and use it in GitHub Desktop.
MyActivity for Animations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyActivity extends Activity { | |
private Animation a; | |
private ImageView im; | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
a = AnimationUtils.loadAnimation(this, R.anim.scaletranslate); | |
a.reset(); | |
im = (ImageView)findViewById(R.id.imageView1); | |
im.setOnClickListener(new OnClickListener() { | |
public void onClick(View v) { | |
im.clearAnimation(); | |
im.startAnimation(a); | |
} | |
}); | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment