zoukankan      html  css  js  c++  java
  • 动画

    引用:http://www.oschina.net/code/snippet_12_1259

    [图片] shot.jpg

    [代码] SplashScreen.java

    01 public class SplashScreen extends Activity {
    02      
    03     /**
    04      * The thread to process splash screen events
    05      */
    06     private Thread mSplashThread;   
    07  
    08     /** Called when the activity is first created. */
    09     @Override
    10     public void onCreate(Bundle savedInstanceState) {
    11         super.onCreate(savedInstanceState);
    12  
    13         // Splash screen view
    14         setContentView(R.layout.splash);
    15          
    16         final SplashScreen sPlashScreen = this;  
    17          
    18         // The thread to wait for splash screen events
    19         mSplashThread =  new Thread(){
    20             @Override
    21             public void run(){
    22                 try {
    23                     synchronized(this){
    24                         // Wait given period of time or exit on touch
    25                         wait(5000);
    26                     }
    27                 }
    28                 catch(InterruptedException ex){                   
    29                 }
    30  
    31                 finish();
    32                  
    33                 // Run next activity
    34                 Intent intent = new Intent();
    35                 intent.setClass(sPlashScreen, MainActivity.class);
    36                 startActivity(intent);
    37                 stop();                   
    38             }
    39         };
    40          
    41         mSplashThread.start();
    42          
    43     }
    44          
    45     /**
    46      * Processes splash screen touch events
    47      */
    48     @Override
    49     public boolean onTouchEvent(MotionEvent evt)
    50     {
    51         if(evt.getAction() == MotionEvent.ACTION_DOWN)
    52         {
    53             synchronized(mSplashThread){
    54                 mSplashThread.notifyAll();
    55             }
    56         }
    57         return true;
    58     }
    59      
    60 }

    [文件] AdvancedSplashDemo.zip ~ 1MB    下载(410)

  • 相关阅读:
    使用Bat自动打包并通过FTP发送到备份服务器——实战测试
    什么是STP
    【基础】华为单臂路由技术配置记录
    Windows Server 2012系统上安装.net framework3.5教程
    eNSP启动设备AR1失败记一次解决步骤
    Linux系统设置 SSH 通过密钥登录
    windows和linux修改ipv6和ipv4的优先级
    思科交换机配置中继
    【Nginx】Nginx反向代理转发Host设置
    idea查看类的uml图
  • 原文地址:https://www.cnblogs.com/sode/p/2186480.html
Copyright © 2011-2022 走看看