Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i runs second animation after first animation?
    primarykey
    data
    text
    <p>I have 2animation and i want first, my background shows with first animation and when first animation finished then my 4 buttons shows with second animation. background and buttons are in one XML file. and i want when animation is runs, onTouch() method not work.</p> <p>I searched and say use AnimationListener but i can't use this! </p> <p>this is my code, please read and help me</p> <pre><code>public class Splash extends Activity { Animation animation1; Animation animation2; Animation animation3; ImageView image; ImageButton circleProduct; ImageButton circleIntroduce; ImageButton circleMore; ImageButton circleContact; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.splash); animation1=AnimationUtils.loadAnimation(this, R.anim.bounce); animation1.setAnimationListener(this); animation2=AnimationUtils.loadAnimation(this, R.anim.push_left_out); animation2.setAnimationListener(this); animation3=AnimationUtils.loadAnimation(this, R.anim.push_left_out); animation3.setAnimationListener(this); image=(ImageView)findViewById(R.id.img); image.startAnimation(animation1); circleProduct=(ImageButton)findViewById(R.id.btnCircleProduct); circleIntroduce=(ImageButton)findViewById(R.id.btnCircleIntroduce); circleMore=(ImageButton)findViewById(R.id.btnCircleMore); circleContact=(ImageButton)findViewById(R.id.btnCircleContact); circleProduct.setVisibility(View.VISIBLE); circleProduct.startAnimation(animation2); circleContact.setVisibility(View.VISIBLE); circleContact.startAnimation(animation2); circleIntroduce.setVisibility(View.VISIBLE); circleIntroduce.startAnimation(animation3); circleMore.setVisibility(View.VISIBLE); circleMore.startAnimation(animation3); image.setOnTouchListener(onTouchListener); circleProduct.setOnClickListener(onClickListener); } private OnTouchListener onTouchListener=new OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub Log.i("clicked", "on the Splas"); Intent intent=new Intent(Splash.this,MainActivity.class); startActivity(intent); //finish(); return false; } }; private OnClickListener onClickListener=new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Log.i("circuleProduct", "clicked"); Intent intent=new Intent(Splash.this,Product.class); startActivity(intent); } }; } </code></pre> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload