//启动动画
mllOverdueDay.startAnimation(animationSet);
mllOverdueDay.setVisibility(View.VISIBLE);
break;
}
return false;
}
});
当启动其他Fragment,Activity并未对本界面进行销毁时AnimationDrawable会停止(回到第一张图片),
返回本界面是可以再次ad.start();//启动动画handler.sendEmptyMessageDelayed(100, 1400);//1400整个动画所需时间,(如有多次启动动画的代码需要handler.removeMessages(100);
<ImageSwitcher
android:id=“@+id/image_SwitcherTop”
android:layout_width=“match_parent”
android:layout_height=“250dp”
android:layout_centerHorizontal=“true”
android:layout_marginTop=“80dp” />
imgIds = new int[]{R.mipmap.icon_splash_top_1, R.mipmap.icon_splash_top_2,
R.mipmap.icon_splash_top_3};
imageSwitcherTop.setFactory(this);
imageSwitcherTop.setImageResource(imgIds[currentPosition % imgIds.length]);
extends BaseActivity implements View