zoukankan      html  css  js  c++  java
  • Android程序启动程序与页面的跳转

    package login;
    
      
    import com.example.login.R;
    
    import android.app.Activity;  
    import android.content.Intent;  
    import android.os.Bundle;  
    import android.view.animation.AlphaAnimation;  
    import android.view.animation.Animation;  
    import android.view.animation.Animation.AnimationListener;  
    import android.widget.ImageView;  
      
    public class splash extends Activity {  
        private ImageView welcomeImg = null;  
      
        @Override  
        protected void onCreate(Bundle savedInstanceState) {  
            super.onCreate(savedInstanceState);  
            setContentView(R.layout.splash);  
            welcomeImg = (ImageView) this.findViewById(R.id.welcome_img);  
            AlphaAnimation anima = new AlphaAnimation(0.3f, 1.0f);  
            anima.setDuration(3000);// 设置动画显示时间  
            welcomeImg.startAnimation(anima);  
            anima.setAnimationListener(new AnimationImpl());  
      
        }  
      
        private class AnimationImpl implements AnimationListener {  
      
            @Override  
            public void onAnimationStart(Animation animation) {  
                welcomeImg.setBackgroundResource(R.drawable.welcome);  
            }  
      
            @Override  
            public void onAnimationEnd(Animation animation) {  
                skip(); // 动画结束后跳转到别的页面  
            }  
      
            @Override  
            public void onAnimationRepeat(Animation animation) {  
      
            }  
      
        }  
      
        private void skip() {  
            startActivity(new Intent(this, LoginActivity.class));  
            finish();  
        }  
    }  

    注意在配置文件中增加activity

    跳转页面

    Intent NewAct = new Intent(SourceAct.this,TargetAct.class);
    startActivity(NewAct);
    SourceAct.this.finish();
  • 相关阅读:
    推荐网址:Response.WriteFile Cannot Download a Large File
    为什么是 My?
    Fox开发杂谈
    DCOM配置为匿名访问
    连接到运行 Windows 98 的计算机
    OO面向对象以后是什么
    Com+的未来是什么?
    fox 表单和类库的加密及修复
    来自 COM 经验的八个教训
    VFP的加密问题
  • 原文地址:https://www.cnblogs.com/zeze/p/4911240.html
Copyright © 2011-2022 走看看