Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MyActivity for Animations
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
You can’t perform that action at this time.