package com.wzhnsc.firstwelcomescreen;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;

public class SplashScreen extends Activity
{
	private static final int GO_HOME_ACTIVITY  = 0x01;
	private static final int GO_GUIDE_ACTIVITY = 0x02;

	// 启动画面显示时长(单位毫秒)
	private static final long SPLASH_SCREEN_DELAY = 2000;

	private Handler mHandler = new Handler()
	{
		@Override
		public void handleMessage(Message msg)
		{
		    Intent intent = null;

			switch (msg.what)
			{
			case GO_HOME_ACTIVITY:
//		        intent = new Intent(SplashScreen.this, MainActivity.class);
			    intent = new Intent(SplashScreen.this, GuideScreen.class);
				break;

			case GO_GUIDE_ACTIVITY:
			    intent = new Intent(SplashScreen.this, GuideScreen.class);
				break;
			}

            startActivity(intent);
            finish();

			super.handleMessage(msg);
		}
	};

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);

		setContentView(R.layout.splash_screen);

        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());

        // 判断程序与第几次运行，如果是第一次运行则跳转到引导界面，否则跳转到主界面
        if (sp.getBoolean(GuideScreen.SP_FIRST_START, true))
        {
            // 使用Handler的postDelayed方法，3秒后执行跳转到MainActivity
            mHandler.sendEmptyMessageDelayed(GO_HOME_ACTIVITY, SPLASH_SCREEN_DELAY);
        }
        else
        {
            mHandler.sendEmptyMessageDelayed(GO_GUIDE_ACTIVITY, SPLASH_SCREEN_DELAY);
        }
	}
}

@@ -306,17 +306,20 @@
 ivity%0A%7B%0A
-%09
+    
 private 
@@ -361,17 +361,20 @@
 = 0x01;%0A
-%09
+    
 private 
@@ -417,17 +417,20 @@
  0x02;%0A%0A
-%09
+    
 // %E5%90%AF%E5%8A%A8%E7%94%BB%E9%9D%A2%E6%98%BE
@@ -439,17 +439,20 @@
 %E9%95%BF(%E5%8D%95%E4%BD%8D%E6%AF%AB%E7%A7%92)%0A
-%09
+    
 private 
@@ -498,17 +498,20 @@
  2000;%0A%0A
-%09
+    
 private 
@@ -543,21 +543,30 @@
 ndler()%0A
-%09%7B%0A%09%09
+    %7B%0A        
 @Overrid
@@ -567,18 +567,24 @@
 verride%0A
-%09%09
+        
 public v
@@ -614,22 +614,34 @@
 ge msg)%0A
-%09%09%7B%0A%09%09
+        %7B%0A        
     Inte
@@ -659,19 +659,28 @@
  null;%0A%0A
-%09%09%09
+            
 switch (
@@ -693,16 +693,34 @@
 at)%0A
-%09%09%09%7B%0A%09%09%09
+            %7B%0A            
 case
@@ -740,18 +740,24 @@
 VITY:%0A//
-%09%09
+        
         
@@ -816,19 +816,28 @@
 class);%0A
-%09%09%09
+            
     inte
@@ -895,23 +895,44 @@
 s);%0A
-%09%09%09%09break;%0A%0A%09%09%09
+                break;%0A%0A            
 case
@@ -951,19 +951,28 @@
 TIVITY:%0A
-%09%09%09
+            
     inte
@@ -1030,22 +1030,43 @@
 s);%0A
-%09%09%09%09break;%0A%09%09%09
+                break;%0A            
 %7D%0A%0A 
@@ -1126,11 +1126,20 @@
 );%0A%0A
-%09%09%09
+            
 supe
@@ -1164,18 +1164,30 @@
 g);%0A
-%09%09%7D%0A%09%7D;%0A%0A%09
+        %7D%0A    %7D;%0A%0A    
 @Ove
@@ -1192,17 +1192,20 @@
 verride%0A
-%09
+    
 protecte
@@ -1251,13 +1251,22 @@
 te)%0A
-%09%7B%0A%09%09
+    %7B%0A        
 supe
@@ -1302,10 +1302,16 @@
 );%0A%0A
-%09%09
+        
 setC
@@ -1848,9 +1848,12 @@
   %7D%0A
-%09
+    
 %7D%0A%7D%0A

replace all tab