0

In my project I am using different animations in a single xml file, like Fruit Ninja game. When I click on the particular image, that image should be invisible and out count will be increase by 100, for this list I want to know how to give on click to moving image i.e., animated image.

 LinearLayout r=new LinearLayout(this);
 i1 = (ImageView)findViewById(R.id.imageView1);
 i2 = (ImageView)findViewById(R.id.imageView2);
 i3 = (ImageView)findViewById(R.id.imageView3);
 i4 = (ImageView)findViewById(R.id.imageView4);
 i5 = (ImageView)findViewById(R.id.imageView5);
 i6 = (ImageView)findViewById(R.id.imageView6);
 i7 = (ImageView)findViewById(R.id.imageView7);
 i8 = (ImageView)findViewById(R.id.imageView8);
 i9 = (ImageView)findViewById(R.id.imageView9);
 i10 = (ImageView)findViewById(R.id.imageView10);

 final Animation an=AnimationUtils.loadAnimation(this,R.anim.custom);
 final Animation an1=AnimationUtils.loadAnimation(this,R.anim.custom1);
 final Animation an2=AnimationUtils.loadAnimation(this,R.anim.custom2);
 final Animation an3=AnimationUtils.loadAnimation(this,R.anim.custom3);
 final Animation an4=AnimationUtils.loadAnimation(this,R.anim.custom4);
 final Animation an5=AnimationUtils.loadAnimation(this,R.anim.custom5);
 final Animation an6=AnimationUtils.loadAnimation(this,R.anim.custom6);
 final Animation an7=AnimationUtils.loadAnimation(this,R.anim.custom7);
 final Animation an8=AnimationUtils.loadAnimation(this,R.anim.custom8);
 final Animation an9=AnimationUtils.loadAnimation(this,R.anim.custom9);
Ajay Soman
  • 1,631
  • 4
  • 19
  • 37
user1696874
  • 13
  • 1
  • 4

1 Answers1

1

Have you tried this

ImageView myImage = (ImageView) findViewById(R.idimageView1);

Then, set Visibility to GONE

myImage.setVisibility(View.GONE);

also check this

Community
  • 1
  • 1
arshad kr
  • 357
  • 3
  • 16