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)

  • 相关阅读:
    一个通用的事件监听函数全集
    单应性矩阵
    opencv姿态估计
    opencv相机标定
    Harris角点
    盒滤波Box Filter
    win10+vs2015+pcl1.8.1安装配置
    图像元素遍历
    阈值分割
    二叉树的层次遍历
  • 原文地址:https://www.cnblogs.com/sode/p/2186480.html
Copyright © 2011-2022 走看看