Android 应用启动渐变效果

/**
* 应用程序启动类:显示欢迎界面并跳转到主界面
* @author liux (http://my.oschina.net/liux)
* @version 1.0
* @created 2012-3-21
*/
public class AppStart extends Activity { @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View view = View.inflate(this, R.layout.start, null);
setContentView(view); //渐变展示启动屏
AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
aa.setDuration(2000);
view.startAnimation(aa);
aa.setAnimationListener(new AnimationListener()
{
@Override
public void onAnimationEnd(Animation arg0) {
redirectTo();
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) {} });
} /**
* 跳转到...
*/
private void redirectTo(){
Intent intent = new Intent(this, Main.class);
startActivity(intent);
finish();
}
}
上一篇:LintCode-乘积最大子序列


下一篇:asp.net 微信企业号办公系统-流程设计--流程步骤设置-事件设置