今天忙活了一下午,僅僅弄出了這一個東西,關鍵還是對Java裡的線程不熟悉。
要做深入的開發的話,Java還得重新看一遍。
代碼很簡單,兩個Activity,一個Handler,一個intent。
package com.example.gtd;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.widget.ImageView;import android.widget.TextView;public class SplashScreen extends Activity {private ImageView logoView;private TextView rightView;private final int SPLASH_DISPLAY_LENGHT = 3000; //延遲三秒 @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.splash_screen);logoView=(ImageView)findViewById(R.id.imageView1);rightView=(TextView)findViewById(R.id.textView1);//logoView.setAlpha(alpha);new Handler().postDelayed(new Runnable(){ @Override public void run() { Intent mainIntent = new Intent(SplashScreen.this, GTD.class); SplashScreen.this.startActivity(mainIntent); SplashScreen.this.finish(); } }, SPLASH_DISPLAY_LENGHT); //updateThread.run();}}